[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

An alternate description of the multiple values proposal



    (I can imagine that if I were considering the design of a new
    language, I might choose a strict semantics in which "for effect"
    implicit continuations accepted -only- zero arguments, and "for value"
    implicit continuations accepted -only- one argument.  There is a
    simple elegance in such a design that I find appealing.)

There are a few problems with requiring "effect" continuations to expect
exactly zero values:

- Backwards compatibility (obviously not a problem with a new
language).

- Is the continuation for the call to FOO an effect continuation or
not?

(let ((ignored (foo <some args>)))
  <some code that does not use ignored>)

- If it is not, then BEGIN is more primitive than I would like to see
it, since the "traditional" expansion as

(begin <exp1> <more>) ->

(let ((ignored1 <exp1>)
      (next1 (lambda () (begin <more>))))
  (next1))

no longer works because the arity of the continuation will be wrong.

- If it is an effect continuation, we have a problem, since in general
we can't decide statically whether a return value will be used or
not, and thus we can't decide in general whether a continuation is
for effect or not.