Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.sprintlink.net!siemens!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 21 Jan 1995 07:40:50 GMT
Message-ID: <BLUME.95Jan21131442@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>
Date: Sat, 21 Jan 1995 18:14:42 GMT
Lines: 31

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.

   Call-with-values avoids that problem.

No.  There is no problem.

   It's safer than returning a vector or list, because the language
   implementation can check that the right number of values were returned, and
   raise an error immediately.

Wouldn't -- (lower your voice to a whisper) -- *typechecking* do the
same thing for you, only even better and earlier (at compile time)?
--- Ok, ok, you don't need to yell at me! :)

   (But you can't depend on that, because the behavior is unspecified.)

Exactly.

--
-Matthias
