Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!satisfied.elf.com!news.mathworks.com!udel!princeton!news.princeton.edu!blume
From: blume@dynamic.cs.princeton.edu (Matthias Blume)
Subject: Re: Explanation about call-with-values
In-Reply-To: djello@well.sf.ca.us's message of 22 Jan 1995 07:20:39 GMT
Message-ID: <BLUME.95Jan22133847@dynamic.cs.princeton.edu>
Originator: news@hedgehog.Princeton.EDU
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: dynamic.cs.princeton.edu
Organization: Princeton University
References: <3fqdq2$9g0@nkosi.well.com> <BLUME.95Jan21131442@dynamic.cs.princeton.edu>
	<3ft107$fgt@nkosi.well.com>
Date: Sun, 22 Jan 1995 18:38:47 GMT
Lines: 48

In article <3ft107$fgt@nkosi.well.com> djello@well.sf.ca.us (Darius Bacon) writes:

   blume@dynamic.cs.princeton.edu (Matthias Blume) writes:

   >In article <3fqdq2$9g0@nkosi.well.com> djello@well.sf.ca.us (Darius Bacon)
   writes:

   >   Call-with-values has a couple advantages that I haven't seen mentioned
   >   yet.

   >   It's more expressive than passing an explicit multi-argument continuation.
   >   Let's say foo calls bar, which makes a tail call to baz.  If we've decided
   >   to return multiple values by calling an explicit continuation, then bar
   has
   >   to know whether or not baz returns multiple values.

   >Wrong.  If it is a tail-call then bar will just pass its own
   >continuation (which is multi-arg) along to baz.

   One of us must misunderstand the other, I think.  I was saying multi-arg
   implicit continuations should be nice to have because they make your
   statement true.

You seem to be the one misunderstanding the other.  If there are no implicit
multi-arg continuations then in order for bar to return multiple values it
must receive an explicit multi-arg continuation as an argument and can pass
it on to baz.  Since it is never calling this continuation itself it doesn't
care how many arguments it takes.

Anyway, I would prefer passing multiple return values in a vector and let
the compiler figure out the details.  I also doubt that this part of the
language constitutes a performance bottleneck at all, so why taking the
trouble?

   And that's annoying.  The above makes a good case (IMO) for call-with-values
   merely rounding out an asymmetry in R4RS Scheme, by allowing implicit
   continuations to take multiple arguments just like ordinary procedures --
   but then they go and underspecify it so badly it can be implemented directly
   in R4RS Scheme.  Are there any good arguments for the Common Lisp behavior
   when the parameters don't match the arguments?  Is there any other
   reasonable behavior?

Are there any *good* arguments for having call-with values at all?  I
think this is the real question, and so far nobody has been able to
convince me that the aswer is `yes'.

--
-Matthias
