[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sending and and or as an argument links their behavior
From: |
Neil Jerram |
Subject: |
Re: sending and and or as an argument links their behavior |
Date: |
Sat, 26 Jan 2008 13:16:34 +0000 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Gregory Marton <address@hidden> writes:
> Hi folks,
>
> I'm wondering what to make of this behavior, seen in both guile 1.8.1
> and 1.8.3, discovered by my colleague L. Brown Westrick, cc:ed above:
>
> guile> (define (apply2 f a b) (f a b))
> guile> (apply2 or #t #f)
> #t
> guile> (apply2 and #t #f)
> #t
> [ #f expected ]
`or' and `and' are macros, and it doesn't work to pass them as
procedure arguments.
I forget for the moment what R5RS says; I suspect the above is not
allowed, and so perhaps Guile should detect it and report an error.
The detailed reason for this is Guile's memoization - but that's not
really the main point.
Regards,
Neil