chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Question about booleans


From: Peter Bex
Subject: Re: [Chicken-users] Question about booleans
Date: Fri, 7 Mar 2014 15:29:49 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Mar 07, 2014 at 02:42:00PM +0100, Daniel Carrera wrote:
> I'm confused. Is "and" defined as a macro? If so, why?

Yes, because it needs to be short-cutting evaluation when it
hits the first #f.  Otherwise (and #f (error "foo")) would
raise the error due to the fact that evaluation of arguments
happens before function invocation.  If you want to use and in
a fold operation, you will be invoking it for each element in
the list even if it returns #f after the first.  Maybe "every"
from srfi-1 is what you're looking for?

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]