[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: when and unless
From: |
Chris K. Jester-Young |
Subject: |
Re: when and unless |
Date: |
Tue, 6 Dec 2011 18:05:56 -0500 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Dec 06, 2011 at 11:08:08PM +0100, David Kastrup wrote:
> > Have you considered using `(values)' as your way of saying, "I'm not
> > returning any values"?
>
> Testing for that is not all that much fun. It is also rather useless
> since pretty much all of the call-for-effect functions of Guile return
> *unspecified* rather than (values).
You're not really supposed to test for it. In fact, if you don't try to
use the value of when, unless, or one-armed ifs, you'll do just fine in
general.
> It is not clear to me why (values) can't just evaluate to a single
> *unspecified* just like '() evaluates to null. Outside of
> call-with-values, I don't see much need to treat it special.
Implementing that would pretty much either require CPS transforms all
around (then you'd look at the arity of the continuation), or else
you'd have to be keeping track of the arity of the current continuation
some other way. Is it just me, or does that smell like Perl's wantarray?
Which brings me to a bigger question---do we even want anything like
wantarray? It seems so insanely hacky (to me), even in Perl code.
Just my humble opinion,
Chris.
- Re: when and unless, Andy Wingo, 2011/12/05
- 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 <=
- Re: when and unless, David Kastrup, 2011/12/07
- Re: when and unless, Chris K. Jester-Young, 2011/12/07
- Re: when and unless, David Kastrup, 2011/12/08
- Re: when and unless, Chris K. Jester-Young, 2011/12/08
- Re: when and unless, David Kastrup, 2011/12/08
- Re: when and unless, Ian Price, 2011/12/08
- Re: when and unless, Chris K. Jester-Young, 2011/12/07
Re: when and unless, Chris K. Jester-Young, 2011/12/06
Re: when and unless, Ludovic Courtès, 2011/12/06