Hi Josef,

I seem to be the negative guy in replies to you. Apologies for that!

On Mon 22 Mar 2010 20:25, Josef Wolf <j...@raven.inka.de> writes:

> On Fri, Mar 19, 2010 at 08:54:02AM -0400, Ken Raeburn wrote:
>> 
>> The result of (if #f #f) is unspecified, not #f, according to r5rs.
>> That means an implementation can produce whatever value it wants.

In the R6RS, evaluating `(if #f #f)' returns "unspecified values" --
that is, even the number of values is unspecified. And in fact it would
make sense for `(if #f #f)' to be the same as `(values)' -- an
expression returning zero values.

> I think I like this type of "unspecified". Much better than the
> "undefined behavior" definition in C.

Unfortunately it really is unspecified :) OK it's better than C, in the
sense that it won't launch the missiles, but it would be better if
evaluating:

   (+ 2 (if #f #f))

yielded an error of "too few values to continuation" rather than "don't
know how to add #<unspecified>".

Cheers,

Andy
-- 
http://wingolog.org/


Reply via email to