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

(reduce #'or ...)

    Date: Mon, 27 Apr 87 12:06:52 PDT
    From: larus@paris.Berkeley.EDU (James Larus)

    I use REDUCE quite frequently and recently ran across a strange
    interaction between it and another CL feature.  I was trying to

	    (reduce #'or (mapcar ...))

Will using "some" solve your problems?  I believe that (some #'f L) is equivalent to
(reduce #'(lambda (x y) (or x y)) (mapcar #'f L) :initial-value nil), except that in most implementations it's faster and
conses less, so  long as f doesn't have side effects.

The fact that and and or only evaluate as many of their arguments as necessary is hardwired into most LISPers spines,
and many believe that using it as a control construct is often more perspicuous than the alternatives.  I think it most
unlikely that it'll be changed.