Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Alternatives to values/call-with-values

View Parsed - Show only message text

Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!newsfeed2.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!news-out.nuthinbutnews.com!propagator2-sterling!In.nntp.be!egsner!news.cirr.com!not-for-mail
From: Category 5 <catfive...@chaosnet.org>
Newsgroups: comp.lang.scheme
Subject: Alternatives to values/call-with-values
Date: Sat, 02 Aug 2003 14:57:15 +0100
Organization: Applied Theology Unlimited
Lines: 83
Message-ID: <yy10d6fodux0.fsf@chaosnet.org>
NNTP-Posting-Host: otaku.freeshell.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: chessie.cirr.com 1059832637 27695 192.94.73.2 (2 Aug 2003 13:57:17 GMT)
X-Complaints-To: abuse@cirr.com
NNTP-Posting-Date: Sat, 2 Aug 2003 13:57:17 +0000 (UTC)
User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.3
Cancel-Lock: sha1:MgDVO3OTMXfSUiCh474oenDeONk=

In a series of threads back in January 1995, Matthias Blume argued
passionately against the presence of values/call-with-values in Scheme
on the grounds that they add nothing to the language as a language -
that is, they grant no additional expressiveness beyond what is already
possible with list and apply, and in fact detract from expressiveness by
forcing us to write things like function composition as

 (define (compose f g)
    (lambda args
       (call-with-values
          (lambda () (apply g args))
          f)))

rather than in the simpler and more obvious way.  Matthias felt that the
introduction of these constructs was a divergence from Scheme's spirit
of orthogonality and challenged Schemers to come up with an argument
justifying their inclusion in the language.  The sparks flew, and the
results appear to have been that most people agreed with Matthias Blume,
with the notable exceptions of William Clinger and Kent Dybvig.  The
primary arguments in favour of values/call-with-values were that they
allow implementors to optimise generated code in ways that are
impossible or more difficult in the list/apply case.

Matthias (and many others) seemed to feel that this was an extremely
suspect reason for altering the foundations of Scheme, and that it
amounted to sacrificing the spirit of the language for a "performance
hack."

Another justification given for values/call-with-values was that they
create a symmetry with the multiple arguments accepted by procedures.
Matthias countered by stating that there was no need to have procedures
accept multiple arguments at all and that Scheme could learn from
languages like ML in this respect.

William Clinger argued in favour of values/call-with-values for some
time.  But in February 1995, in <3gr4ls$...@narnia.ccs.neu.edu>, he
appeared to have second thoughts of a sort.  He writes:

> I have misunderstood several of the points that Matthias Blume has
> been trying to make.  As I now understand his arguments, Matthias has
> not been criticizing the multiple values proposal.  Instead he has
> been criticizing various misfeatures of Scheme that make multiple
> values appear necessary.
> [...]
> I will then outline some changes to Scheme that would make multiple
> values unnecessary.  These changes are radical, yet they would not
> break any code written in R4RS Scheme.
> [...]
> This proposal would address all three of the above criticisms without
> breaking *any* portable Scheme code.  On the other hand, this proposal
> would require changes to all existing implementations of Scheme.

The proposal involves the introduction of a new data type called a
'sequence'.  With this approach,

> [E]very procedure takes exactly one argument and returns exactly one
> result.  The argument and the result will always be a sequence. [...]
> An expression in tail-recursive position returns a one-element
> sequence.  Continuations accept sequences containing an arbitrary
> number of elements as results.

To my surprise, this proposal generated almost no discussion.  In fact,
it seemed to mark the end of the original one, and since then people
seem to have resigned themselves to values/call-with-values, occasional
fulminations aside.

My questions:

1.  Is this proposal still viable for Scheme, as a language, today?

2.  What are the thoughts of implementors on the proposal?

3.  Have people really resigned themselves to values/call-with-values,
    both
      a) as a specific means of handling multiple return values, and
      b) as the philosophical departure from the roots of the language
         they (arguably) represent?

4.  Does anyone have any other ideas for dealing with the problem of
    multiple return values that haven't been raised yet?

-- 
 

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google