From: Hidayet Tunc Simsek
Subject: REDUCE and AND
Date: 
Message-ID: <3815093B.12003088@EECS.Berkeley.Edu>
Hi,  I have the following problem with REDUCE and AND:

> (reduce #'and '(T T nil T))

=> Error in function "DEFUN (SETF MACRO-FUNCTION)":
	Cannot funcall macro functions

Any suggestions?

Tunc

From: Jeff Greif
Subject: Re: REDUCE and AND
Date: 
Message-ID: <Ar8R3.176$6S2.2162914@dca1-nnrp1.news.digex.net>
Try
(reduce #'(lambda (x y) (and x y)) '(t t nil t))
From: Hidayet Tunc Simsek
Subject: Re: REDUCE and AND
Date: 
Message-ID: <3815185E.72D813B6@EECS.Berkeley.Edu>
Jeff Greif wrote:
> 
> Try
> (reduce #'(lambda (x y) (and x y)) '(t t nil t))

Great, thanks.

Tunc
From: Samir Barjoud
Subject: Re: REDUCE and AND
Date: 
Message-ID: <wkr9iiahx8.fsf@mindspring.com>
"Jeff Greif" <···@spam-me-not.trivida.com> writes:

> Try
> (reduce #'(lambda (x y) (and x y)) '(t t nil t))
> 

Assuming the original poster intended to use the construct to test if
a list contains all true (non nil) values it is better to use EVERY.

(every #'identity '(t t nil t))

EVERY returns false when the predicate (in this case, IDENTITY)
returns false.  REDUCE always processes the entire sequence.

-- 
Samir Barjoud
·····@mindspring.com
From: Paul Dietz
Subject: Re: REDUCE and AND
Date: 
Message-ID: <7v4jid$lj9$1@schbbs.mot.com>
In article <··············@mindspring.com>,
Samir Barjoud  <·····@mindspring.com> wrote:
>"Jeff Greif" <···@spam-me-not.trivida.com> writes:
>
>> Try
>> (reduce #'(lambda (x y) (and x y)) '(t t nil t))
>> 
>
>Assuming the original poster intended to use the construct to test if
>a list contains all true (non nil) values it is better to use EVERY.
>
>(every #'identity '(t t nil t))

For LOOP fans:

  (loop for x in '(t t nil t) always x)

ACL, at least, compiles the first into a call to EVERY
and the second into an open loop.

	Paul
From: Paul Rudin
Subject: Re: REDUCE and AND
Date: 
Message-ID: <wk4sfava9q.fsf@scientia.com>
>>>>> "Jeff" == Jeff Greif <···@spam-me-not.trivida.com> writes:


 Jeff> Try (reduce #'(lambda (x y) (and x y)) '(t t nil t))

or:

   (every #'identity '(t t nil t))





 Sent via Deja.com http://www.deja.com/
 Before you buy.
From: Arseny Slobodjuck
Subject: Re: REDUCE and AND
Date: 
Message-ID: <381aec67.17281048@news.vtc.ru>
>Try
>(reduce #'(lambda (x y) (and x y)) '(t t nil t))
Excuse me, what this "function" stands for ?
It's work without that, in form
(reduce (lambda (x y) (and x y)) '(t t nil t))
From: Rolf-Thomas Happe
Subject: Re: REDUCE and AND
Date: 
Message-ID: <r5ogdh9be1.fsf@bonnie.mathematik.uni-freiburg.de>
Arseny Slobodjuck:
> >(reduce #'(lambda (x y) (and x y)) '(t t nil t))
> Excuse me, what this "function" stands for ?

"The function described by the lambda list."

> It's work without that, in form
> (reduce (lambda (x y) (and x y)) '(t t nil t))

The LAMBDA _macro_ let's you get away without the #' or FUNCTION.

rthappe