Common lisp, undefined intersection function behavior?

According to the CLHS entry for the INTERSECTION function ( http://www.lispworks.com/documentation/HyperSpec/Body/f_isec_.htm ):

For each pair that satisfies the test, exactly one of the two elements of the pair will be placed in the result.

My problem is that I need to know which of the two elements of the pair will be placed in the result, which matters when, for example, a :key #'cartest against is used to extract arguments, since cdr may differ. I would like to have a guarantee that either the first or always the second element will be placed in the result. Am I missing something or is this just unspecified behavior, so shouldn't I use it for my case?

+5
source share
1 answer

intersectionjust does not make the guarantee you want; it implements a set-theoretic intersection with many additional functions, but is simply not additional. You will have to collapse yourself.

+5
source

All Articles