Slobodan Blazeski <slobodan.blazeski@gmail.com> wrote:
+---------------
| Marco Antoniotti <marc...@gmail.com> wrote:
| > (remove 'paper '((test 1) (paper 2) (pen 2) (paper 3) (paper 4) (pen 7))
| > :test (complement 'eql)
| > :key 'first)
|
| Very nice.
+---------------
One tiny quibble: (COMPLEMENT 'EQL) won't work [at least, not portably]
since COMPLEMENT takes a function, not a function designator. You need
to write it as (COMPLEMENT #'EQL). On the other hand, :TEST-NOT [1]
does take a function designator and thus this works portably:
> (remove 'paper '((test 1) (paper 2) (pen 2) (paper 3) (paper 4) (pen 7))
:test-not 'eql :key 'first)
((PAPER 2) (PAPER 3) (PAPER 4))
>
-Rob
[1] Which I stubbornly persist in using despite its "deprecated" status! ;-}
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607