3 ms·
TXR Lisp: hash-uni: http://www.nongnu.org/txr/txr-manpage.html#N-00F548D1 http://www.nongnu.org/txr/txr-manpage.html#N-00F548D1 For cases when the key occurs
by kazinator 10y ago
TXR Lisp: hash-uni:
http://www.nongnu.org/txr/txr-manpage.html#N-00F548D1 http://www.nongnu.org/txr/txr-manpage.html#N-00F548D1
For cases when the key occurs in both hashes, you can specify a join-func which takes the two values. Its return value is used to populate the key in the union. The default behavior is to take the left value.
This is very useful.
Suppose that both hashes associate keys with lists. We want all the items in the union: [hash-uni left right append].
We have two frequency histograms. We want to combine them: [hash-uni left right +].