[Top][All Lists]

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

Re: Problem with cond macro.

From: Keith Wright
Subject: Re: Problem with cond macro.
Date: Wed, 17 Apr 2002 01:34:33 -0400

> From: address@hidden (Julian v. Bock)
> >>>>> "PV" == Panagiotis Vossos <address@hidden> writes:
> PV> Ok, I just started studying macros, so I might be missing
> PV> something obvious, but the following example from r5rs doesn't
> PV> work correctly with guile:
> guile> (let ((=> #f))
> guile>         (cond (#t => 'ok)))
> guile> In expression (cond (#t => #)): 
> guile> Wrong type to apply: ok ABORT:

I see no macro here.  Aren't you using the Guile built-in version
of COND?

> This works only if cond is implemented as a R5RS macro. This is not
> guaranteed by the standard though.

That's not the way I read it.  R5RS 4.3.2 (near the end) says:

R5RS> As an example. if LET and COND are defined as in section 7.3
R5RS> then they are hygenic (as required) and the following is
R5RS> not an error.
R5RS>         <above example>

I take this to mean that the behaviour shown is required, and
that furthermore the hygenic macro system exhibits the required
behaviour.  Thus the built-in COND should work in the same
way as the example implementation given in the R5 Report,
even though it may be implemented more (or less) efficiently.

     -- Keith Wright  <address@hidden>

Programmer in Chief, Free Computer Shop <>
         ---  Food, Shelter, Source code.  ---

reply via email to

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