[Top][All Lists]
[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: |
Mon, 05 Dec 2011 21:23:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Heya Ludo,
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.
Andy
--
http://wingolog.org/
- Re: when and unless,
Andy Wingo <=
- Re: when and unless, Marijn, 2011/12/06
- Re: when and unless, Alex Shinn, 2011/12/06
- Re: when and unless, David Kastrup, 2011/12/06
- Re: when and unless, Andy Wingo, 2011/12/06
- Re: when and unless, David Kastrup, 2011/12/06
- Re: when and unless, Andy Wingo, 2011/12/06
- Re: when and unless, David Kastrup, 2011/12/06
- Re: when and unless, Chris K. Jester-Young, 2011/12/06
- Re: when and unless, David Kastrup, 2011/12/07
- Re: when and unless, Chris K. Jester-Young, 2011/12/07