[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] "unspecified values"

On 05/20/2011 08:46 AM, John Cowan wrote:
> Andy Wingo scripsit:
>> I think that Per is saying that if `set!' returns no values, then
>> there is nothing for P to ignore.
> Sure.  But "making the REPL nicer" is not an argument in favor of set!
> returning no values, as the REPL can be just as nice when set! returns a
> (distinguished) value.

But there is an elegance to doing it this way: If the REPL prints out all
the values of multiple values, then doing nothing when there are no values
doesn't even require special casing.  (Some fudging is involved in terms
of when to emit newlines or whitespace.)

Having set! etc return no values also interacts nicely with a set of
alternative syntactic forms where <body> is effectively append-values.
This makes for a very pleasant and composable API, though I won't into
that here.  (Imagine the composability of XQuery sequences with the
tool-friendliness of shell with the power of Scheme.)
	--Per Bothner
per@x   http://per.bothner.com/

Scheme-reports mailing list