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: Fri, 01 Jul 2011 09:50:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi :)

On Thu 30 Jun 2011 23:46, address@hidden (Ludovic Courtès) writes:

>   http://lists.r6rs.org/pipermail/r6rs-discuss/2007-March/thread.html#1856

Wow, forgot about that one ;)

> Here’s another argument: these macros are about writing imperative code,
> which, as we all know, is Evil.  As such, they are unacceptable.
>
> (Seriously though, I won’t use them but won’t complain either if they
> land in Guile.)

OK, cool.

One place you might want to use them though is in type checks for Scheme
code.  We currently don't do very much of that, but probably should in
the future.  As in:

  (define (parameter-fluid p)
    (unless (parameter? p) (wrong-type-arg p 'parameter))
    (struct-ref p 1))

The advantage of `unless' over `if' is that the wrong-type-arg is not
called in tail position, so the error message sees `parameter-fluid' on
the stack.

Andy
-- 
http://wingolog.org/



reply via email to

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