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 Alaric Snell-Pym 23 May 2011 11:45 UTC

On 05/22/11 17:43, Peter Bex wrote:

> 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.

I like this idiom, too.

At a pinch, I'd suggest that continuations expecting less values than
are found should happily discard the extra values; but continuations
that expect more than are found (most pertinently, expecting one and
getting zero...) should raise an error rather than sliding in an
'undefined value' that will just trip you up further down the road
unless you're careful to check for it (like a NULL in C or Java...)

> Cheers,
> Peter

ABS

--
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/

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