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

An alternate description of the multiple values proposal

   Date: Fri, 1 Sep 89 17:57:54 edt
   From: jinx (Guillermo J. Rozas)

       (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:

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

   (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>))))

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

The continuation for this call is -not- an "effect" continuation.  I
don't see this as a problem -- it merely means that the expansion for
`begin' must be described in terms of `call-with-values':

(begin <action> <more>)  ->
(call-with-values (lambda () <action>) (lambda () (begin <more>)))

I don't see this as being appreciably different.  I also don't see any
problem with "primitiveness" since `call-with-values' must be
implemented as a primitive in any case.