guile-devel
[Top][All Lists]
Advanced

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

Re: when and unless


From: Andy Wingo
Subject: Re: when and unless
Date: Sat, 07 Jan 2012 01:16:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi,

On Wed 07 Dec 2011 15:19, address@hidden (Ludovic Courtès) writes:

>>> On Thu 30 Jun 2011 12:44, Andy Wingo <address@hidden> writes:
>>>
>>>> I think we should add `when' and `unless' to the default environment.
>
> Like Marijn, it seems more natural for me to return the values of the
> body’s last expression, rather than *unspecified*.

Given that there are reasonable cases for `when' and `unless' in
side-effecting loops, it is indeed probably best to preserve the
<tail sequence> nature of the body of these forms.

Are you OK with adding them like this:

 (define-syntax (when condition stmt stmt* ...)
   (if condition (begin stmt stmt* ...)))

 (define-syntax (unless condition stmt stmt* ...)
   (if (not condition) (begin stmt stmt* ...)))

Andy
-- 
http://wingolog.org/



reply via email to

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