[plt-scheme] Please help test version 359.100
hufflen jean-michel skrev:
>>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.
Note that PLT repl doesn print void. So 1 and 3 does produce a value.
; [1]
> (display (for-each write '()))
#<void>
; [1]
> (eq? (for-each write '())
(void))
#t
; [3] yields the same as [1], that is, no value.
> (display checking-for-each)
#<void>
See section 3.1 in the MzScheme Language Manual.
--
Jens Axel Søgaard