[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Canonicalization of predicate oredering in DEL, MEM, etc.
- Subject: Re: Canonicalization of predicate oredering in DEL, MEM, etc.
- From: Guy.Steele at CMU-10A
- Date: Tue ,13 Jan 81 18:04:00 EDT
Up to now, the functions DEL, MEM, etc. have been thought of as
taking an equality predicate so that one could write, for example,
(MEM #'= X Y) or (DEL #'STRING-EQUAL X Y). However, the semantics
could be usefully extended to allow ordering operators:
(MEM #'LESSP 3 X)
clearly looks for an element of X which is less than 3... or which
3 is less than. Which?
I suggest that part of the definition be that the item and
the list element are fed to the predicate *in that order*,
to resolve the ambiguity. (I propose that order rather than the other
order because the item and list arguments appear in that order.)
Therefore (MEM #'LESSP 3 X) would look for an element that 3 is less than.
Does anyone object to this becoming standard? I realize that poone could
write (MEM-IF #'(LAMBDA (Y) (LESSP 3 Y)) X), but if that 3 is
a local variable then either MEM-IF must be open-coded or you get the
funarg problem... (grr.)