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
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Category 5  
View profile   Translate to Translated (View Original)
 More options 2 Aug 2003, 14:57
Newsgroups: comp.lang.scheme
From: Category 5 <catfive...@chaosnet.org>
Date: Sat, 02 Aug 2003 14:57:15 +0100
Local: Sat 2 Aug 2003 14:57
Subject: Alternatives to values/call-with-values
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?

--


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

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