[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] multiple values module
- To: scheme-reports@x
- Subject: Re: [Scheme-reports] multiple values module
- From: Peter Bex <Peter.Bex@x>
- Date: Sun, 22 May 2011 18:43:53 +0200
- In-reply-to: <8C13C3E4908E42B997F05E8164E543D7@SIXFOUR>
- Mail-followup-to: scheme-reports@x
- References: <op.vvsfyzmc0p3ku8@localhost> <m3wrhltin9.fsf@unquote.localdomain> <8C13C3E4908E42B997F05E8164E543D7@SIXFOUR>
On Fri, May 20, 2011 at 10:07:04PM +0200, xacc.ide@x 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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports