Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!princeton!news.princeton.edu!blume
From: blume@atomic.cs.princeton.edu (Matthias Blume)
Subject: Re: Explanation about call-with-values
In-Reply-To: will@ccs.neu.edu's message of 26 Jan 1995 16:58:08 GMT
Message-ID: <BLUME.95Jan27121217@atomic.cs.princeton.edu>
Originator: news@hedgehog.Princeton.EDU
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: atomic.cs.princeton.edu
Organization: Princeton University
References: <3ft107$fgt@nkosi.well.com>> <BLUME.95Jan22133847@dynamic.cs.princeton.edu>
	<3g004e$7ps@nkosi.well.com> <3g8kb0$1pr@narnia.ccs.neu.edu>
Date: Fri, 27 Jan 1995 17:12:17 GMT
Lines: 42

In article <3g8kb0$1pr@narnia.ccs.neu.edu> will@ccs.neu.edu (William D Clinger) writes:

   blume@dynamic.cs.princeton.edu (Matthias Blume), trying to deny that
   multiple values offer the potential for better error checking than
   returning a list, writes:
       Huh?  How can this happen?  There are only two things you can possibly
       do with the result of `values':  you can pass it on to your caller by
       having it in tail position or you can take it apart.  Passing it on
       will never trigger an error, neither in the `values' scheme nor in the
       `list' scheme....

   This is not true.  The buggy-mv program below contains an error that
   implementations are encouraged (but not required) to detect and report.
   The buggy-list program has the same conceptual error, but no
   IEEE-conforming implementation is allowed to report it.

   [ goes on posting a program, which takes the `list'-substitute for
     `values' apart using `car' and `cdr' ]

I was referring to an implementation of values and call-with-values as in:

   (define values list)
   (define (call-with-values thunk receiver) (apply receiver (thunk)))

which makes the container carrying multiple values first-class.  In
this case (and provided containers are printable) the `bug' in your
program (not explicitely ignoring the second value from `split' in the
initial call to split) is not an error at all -- because there is only
one value (the container).  I strongly believe that containers ought
to be first class, and that this is the correct behavior for them
(i.e. The Right Thing). I agree that this doesn't precisely match the
specifications for values/call-with-values as given in the `june 1992'
paper.  But to me this is actually a good thing.

---

With this let me conclude my tirade against the newest trends in
Scheme.  I actually have other things to do, and it is unlikely, that
I can make even just a dent in what has been proposed by others.

--
-Matthias
