Re: [Scheme-reports] Technical question Aaron W. Hsu (26 May 2011 22:01 UTC)
Re: [Scheme-reports] Technical question Alex Shinn (26 May 2011 22:25 UTC)
Re: [Scheme-reports] Technical question Eli Barzilay (29 May 2011 08:50 UTC)
Re: [Scheme-reports] Technical question Jay Reynolds Freeman (26 May 2011 23:07 UTC)
Re: [Scheme-reports] Technical question Anton van Straaten (27 May 2011 03:04 UTC)
Re: [Scheme-reports] Technical question Jay Reynolds Freeman (27 May 2011 04:36 UTC)
Re: [Scheme-reports] Technical question Anton van Straaten (27 May 2011 08:43 UTC)
Re: [Scheme-reports] Technical question Ray Dillinger (27 May 2011 16:35 UTC)
Re: [Scheme-reports] Technical question John Cowan (27 May 2011 18:02 UTC)
Re: [Scheme-reports] Technical question Andy Wingo (27 May 2011 06:58 UTC)

Re: [Scheme-reports] Technical question Jay Reynolds Freeman 26 May 2011 23:06 UTC

I am *not* in WG1, but Aaron has asked for comments that contrast
with his opinion, so I shall risk speaking up ...

One could argue that the continuation k which is to receive the
three values 1, 2, and 3, is within the body of the unnamed lambda
expression

    (lambda ()
      (call-with-current-continuation (lambda (k) (k 1 2 3)))
      ;;
      ;; <-- continuation k is right here, so to speak
      ;;
      )

That is, the task of continuation k is to wrap up whatever the
unnamed lambda expression is going to return, and return it.
Continuation k is not explicitly created by "call-with-values"
-- that procedure is not used in the unnamed lambda expression;
rather, continuation k is created by the unnamed lambda expression.
Thus continuation k must take exactly one value, so it is an error
for k to be called with the three values 1, 2, and 3, and an
implementation might well choose to report that error.

The unnamed lambda expression itself is certainly providing values
to a continuation created by "call-with-values", so the unnamed lambda
expression is allowed to return multiple values, but as far as
I can tell, the only means it has to do so in R5 Scheme is by using
"values", e.g. (to pick an example using call/cc somehow) perhaps:

    (lambda ()
         (values
           (call-with-current-continuation (lambda (k) (k 'just-one-value)))
           <something-else>
           ...
           ))

<Insert here canonical apologies for wading into a cat fight without
proper formal introductions to any of the cats ...  :-)  :-)  :-)  >

--  Jay Reynolds Freeman
---------------------
Jay_Reynolds_Freeman@mac.com
http://web.mac.com/jay_reynolds_freeman (personal web site)

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