Re: [Scheme-reports] multiple values module xacc.ide@gmail.com (20 May 2011 20:07 UTC)
Re: [Scheme-reports] multiple values module Peter Bex (22 May 2011 16:49 UTC)
Re: [Scheme-reports] multiple values module Alaric Snell-Pym (23 May 2011 11:49 UTC)
Re: [Scheme-reports] multiple values module Aaron W. Hsu (23 May 2011 22:05 UTC)

Re: [Scheme-reports] multiple values module Peter Bex 22 May 2011 16:43 UTC

On Fri, May 20, 2011 at 10:07:04PM +0200, xacc.ide@gmail.com wrote:
> If your Scheme accepts (values 1 (values 1 2 3) 3) [1], your Scheme is
> broken.

Broken by what definition?  The standard is supposed to be a report of
common practice.  As John pointed out, there are more implementations
that accept it than do not, so it makes sense that the report allow this.

Originally, I strongly disagreed with Felix's choice when he modified
MV handling to discard extra values in single-value contexts because
I thought it was weird and unschemely (and maybe "broken").

Today, I even *rely* on this behaviour in some of my code and am very
happy this change was made.  This just shows that there's no one
obviously "right" way to do this, and each approach has its merits.
It's unfair to dismiss a consciously made choice like that as "broken".

This behaviour is quite practical and even enables a new idiom;
procedures can return one "main" value and several additional values
that you might sometimes need.  Then you can just call the procedure
as if it returned one value when you don't need the extra info.

Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports