[r6rs-discuss] "Unspecified"

Anton van Straaten anton at appsolutions.com
Thu Sep 21 19:36:58 EDT 2006


((Speaking for myself, not for the editors:))

Jonathan A Rees wrote:
> 
> On Sep 20, 2006, at 6:12 PM, Jason Orendorff wrote:
> 
>> Does anyone else feel a little weird about the phrase "the  
>> unspecified value"?
> 
> 
> I do. This feature of the R6RS draft is an oxymoron and offensive to  
> common sense.
> 
> In order for something to be unspecified, someone or something (in  this 
> case, the report or its authors) has to fail to specify what it  is. 

When you write (if b x) in a program, you haven't specified what should 
be returned if b is false.  The value of the expression in that 
situation is unspecified.  The perpetrator of the unspecified behavior 
is not the R6RS draft, but rather the program(mer).  The R6RS draft 
simply specifies that in such situations, implementations must return a 
value which denotes that no value was specified.

> That is just what 'unspecified' means, and we don't have any  choice 
> about it. If you say that the value of an expression is 'the  
> unspecified value', you have specified what it is - pure double-talk.

"The unspecified value" is shorthand for something longer, such as "the 
value which denotes that no value was specified".

I agree that there's potential for confusion with other uses of the word 
"unspecified", and that should be clarified.

> I think what is intended is that there is some particular value V  
> (which needs a name so that we can talk about it) that will be  
> delivered in a number of special situations. 

It's more specific than that, though - the value in question is 
delivered in certain situations in which the value of an expression is 
unspecified.

> It's incorrect to tell people (page 20) that V is meaningless. As  soon 
> as you specify anything about it, such as that it is not a  number or 
> that you can get your hands on it in multiple particular  ways, it has 
> meaning.

I agree with that.

> Whether you *want* to specify anything about the value delivered in  all 
> these situations is not at all obvious. I can think of several  possible 
> reasons (none of which I agree with) but I don't see any  rationale for 
> this incompatible change (or any other, for that  matter) spelled out 
> anywhere; what did I miss?
> 
> (And don't point to my own installation of #{unspecific} into Scheme  48 
> as contradicting what I say - the name is 'unspecific' instead of  
> 'unspecified', it was intended to be undocumented (unspecified!), and  
> it was meant to be tongue-in-cheek, not binding.)

A value named "unspecified" (or #<unspecified>, #!unspecified etc.) is 
used by Chicken, Larceny, and SCM, at least.  Others (in addition to 
Scheme 48) use some variant such as "unspecific".  Others, of course, 
use a variation on "void", apparently borrowed from C.

While there's a certain quirky charm in choosing not to specify the 
value of expressions which have a value but don't explicitly specify 
what that value is, in practice, the major Scheme implementations all 
provide such a value, all with slightly different names.  The question 
is really what the benefit is in not specifying this value.  If Schemes 
were routinely using something other than a mostly meaningless 
"unspecified" value, which had some valid purpose, the situation would 
be different.

Anton




More information about the r6rs-discuss mailing list