[pro] (values) for for-effect functions

Pascal Costanza pc at p-cos.net
Tue Dec 7 18:20:44 UTC 2010


On 3 Dec 2010, at 13:34, Martin Simmons wrote:

> I think it is confusing to use (values) for that purpose, because "no values"
> is also a valid return value (e.g. for reader macro functions
> http://www.lispworks.com/documentation/HyperSpec/Body/02_add.htm).
> 
> I would make it a macro, called something like void.
> 
> OTOH, use of (values) or (void) will prevent tail call optimization, so may be
> undesirable.

I think this is the strongest argument in this thread: Most other arguments seem to point out only subjective and/or stylistic issues, while this one is a hard technical difference. Preventing tail call optimizations for stylistic issues is a bad idea, IMHO.

I have occasionally used the (values) idiom, but only in test situations, when I don't like seeing return values in the REPL. I seem to recall some uses of (values) in PCL.

Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium










More information about the pro mailing list