[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sequence function predicate arg order
- To: BSG@SCRC-STONY-BROOK.ARPA
- Subject: Sequence function predicate arg order
- From: Moon@SCRC-STONY-BROOK.ARPA
- Date: Fri, 7 Sep 84 16:18 EDT
- Cc: Common-Lisp@SU-AI.ARPA, bug-clcp@SCRC-STONY-BROOK.ARPA, dla@SCRC-STONY-BROOK.ARPA
- In-reply-to: <840907153454.7.BSG@CONCORD.SCRC.Symbolics>
- Redistributed-date: Tue, 11 Sep 84 12:53 EDT
- Redistributed-to: Common-Lisp@SU-AI.ARPA
Date: Friday, 7 September 1984, 15:34-EDT
From: Bernard S. Greenberg <BSG at SCRC-TENEX>
The following issue was encountered today by David Andre. He wanted
to find the position of first element in a string which was not an element of a list
he had in hand....
Possible outcomes:
1. Magic keyword to sequence functions to reverse test arg order? ECCH!
2. More string-specific primitives.
3. Maybe he should have said :test #'(lambda (x y)(member y x)).
Among your alternatives, I'd prefer #3, i.e. write
(position list sequence :test-not #'(lambda (x y) (member y x)))
I would actually write
(position-if-not #'(lambda (item) (member item list)) sequence)