guile-devel
[Top][All Lists]
Advanced

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

Re: when and unless


From: Ludovic Courtès
Subject: Re: when and unless
Date: Wed, 07 Dec 2011 15:19:58 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Hi,

address@hidden (Ludovic Courtès) skribis:

> Andy Wingo <address@hidden> skribis:
>
>> On Thu 30 Jun 2011 12:44, Andy Wingo <address@hidden> writes:
>>
>>> I think we should add `when' and `unless' to the default environment.
>>>
>>> They go like this:
>>>
>>>   (define-syntax when
>>>     (syntax-rules ()
>>>       ((_ test then then* ...)
>>>        (if test (begin then then* ... (if #f #f))))))
>>>
>>>   (define-syntax unless
>>>     (syntax-rules ()
>>>       ((_ test else else* ...)
>>>        (if (not test) (begin else else* ... (if #f #f))))))
>>
>> WDYT?  `unless' is nice for assertions, `when' is its converse, and most
>> Schemes have them.  I would like to add them to Guile too.
>
> Yes, feel free.

Like Marijn, it seems more natural for me to return the values of the
body’s last expression, rather than *unspecified*.

Thanks,
Ludo’.




reply via email to

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