[plt-scheme] Please help test version 359.100

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue Nov 14 13:45:37 EST 2006

At Tue, 14 Nov 2006 18:54:24 +0100 (CET), hufflen jean-michel wrote:
> >From hufflen at lifc.univ-fcomte.fr  Tue Nov 14 18:11:42 2006
> >(...)
> 
> >   The notion of *unspecified value* is ambiguous. It may be:
> >   - any value, possibly chosen randomly,
> >   - no value, or (why not?) several values as Scheme functions may return
> >multiple values.
> 
>    After checking, the situation is more ambiguous than I was thinking. Let us
> consider:
> 
> [0] (for-each write '())
> [1] (define checking-for-each (for-each write '()))
> [2] (define checking-zero-value (values))
> [3] checking-for-each
> [4] checking-zero-value
> [5] (eq? checking-for-each (for-each write '()))
> 
>    PLT accepts [0], [1], but not [2], although [0] and [1] do not result in a
> value. [3] yields the same as [1], that is, no value. [5] yields "#t".  That
> is, unspecified values sometimes behave like a single value, even if there are
> no such.

PLT produces a particular value (called "void") in those situations,
except [2] (and [5], of course, where it produces a boolean). You can
make it yourself:

> (void)
#<void>
> (void? (void))
#t

Robby



Posted on the users mailing list.