[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

> 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,

reply via email to

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