According to CLHS entry for the INTERSECTION function (http://www.lispworks.com/documentation/HyperSpec/Body/f_isec_.htm):
For every pair that satifies the test, exactly one of the two elements of the pair will be put in the result.
My problem is that i need to know which one of the two elements of the pair will be put in the result, which matters when, for example :key #'car
is used to extract the arguments to test against, since the cdr might be different. I would like to have a guarantee that either always the first or always the second element will be put in the result. Am I missing something or is this just unspecified behaviour, so I shouldnt use it for my case?
intersection
simply doesn't make the guarantee you want; it implements set-theoretic intersection with a lot of extras, but just not that extra. You'll have to roll your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With