[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bard Bloom <bard@THEORY.LCS.MIT.EDU>: ANY and ANY?]

In article <26643@yale-celray.yale.UUCP>, slade-stephen@yale writes:
>   T seems to have two functions, called ANY and ANY?, which evidently
> behave identically.  Both of them are documented.  Both ANYs take a
> predicate and some lists, and call predicate on successive cars of lists,
> until it returns true; then the ANY returns true.  If none do, it returns
> false.  The two are not EQ?.

ANY and ANY? do not behave identically, but they're pretty close.  I don't
know how the manual is worded, but I think ANY is supposed to return the
first non-nil value that the predicate returns, whereas ANY? returns #T
or #F (true or false).  When I last checked, the definition of ANY? was
something like:

    (define-integrable any? (compose true? any))

Similarly ANYCDR?, EVERY? and EVERYCDR?.  If you call ANY with a true
predicate, both ANY and ANY? will behave identically.

-- Ashwin.

ARPA:    Ram-Ashwin@cs.yale.edu
UUCP:    {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET:  Ram@yalecs