[Scheme-reports] "unspecified values" Andy Wingo (19 May 2011 15:49 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (19 May 2011 16:11 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (19 May 2011 17:11 UTC)
Re: [Scheme-reports] "unspecified values" Alex Shinn (21 May 2011 05:04 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (21 May 2011 08:52 UTC)
Re: [Scheme-reports] "unspecified values" Jim Rees (21 May 2011 13:58 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (21 May 2011 15:10 UTC)
Re: [Scheme-reports] "unspecified values" John Cowan (21 May 2011 18:24 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (22 May 2011 13:28 UTC)
Re: [Scheme-reports] "unspecified values" Andre van Tonder (21 May 2011 15:19 UTC)
Re: [Scheme-reports] "unspecified values" Alex Shinn (21 May 2011 18:19 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (23 May 2011 11:34 UTC)
Re: [Scheme-reports] "unspecified values" John Cowan (23 May 2011 15:57 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (23 May 2011 11:20 UTC)

Re: [Scheme-reports] "unspecified values" John Cowan 21 May 2011 18:24 UTC

Andy Wingo scripsit:

> On Sat 21 May 2011 15:57, Jim Rees <jimreesma@gmail.com> writes:
>
> > apparently every major implementation wraps up multiple values
> > into a single first-class object which can be passed around until
> > a call-with-values detects it and de-composes it again  (please
> > correct me if I'm wrong).
>
> Guile does not do this.  Chez does not either FWIW.  Dunno about
> ikarus; I think that it also follows the approach I linked to
> previously:
>
>   http://www.cs.indiana.edu/~dyb/pubs/mrvs.pdf

Chicken doesn't either: it CPS-converts everything, so that procedures
and continuations are the same thing, and returning multiple values to
a continuation is just calling a procedure with multiple arguments,
IMO a very elegant approach.  The only drawback is that the compiler
can usually tell how many arguments a procedure expects, whereas a
continuation has to check at run time how many values it got, and take
corrective action if the number is wrong.

As I posted earlier, Chicken uses the "truncate two or more values
to the first value" strategy.  If no values are received but one is
expected, Chicken continuations get the #<undefined> object.  This is
the same one returned by standard procedures returning "an undefined
value", and is also returned by the Chicken core procedure `void`.

--
Deshil Holles eamus.  Deshil Holles eamus.  Deshil Holles eamus.
Send us, bright one, light one, Horhorn, quickening, and wombfruit. (3x)
Hoopsa, boyaboy, hoopsa!  Hoopsa, boyaboy, hoopsa!  Hoopsa, boyaboy, hoopsa!
  --Joyce, Ulysses, "Oxen of the Sun"       cowan@ccil.org

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