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

Revised WITH-VALUES and VALUES (I think we are near agreement!)

>> From: Guillermo J. Rozas <jinx@hpesogg.hp.com>
>> I will accept the proposal if it leaves the arity of implicit
>> continuations unspecified, and it is explicitely stated.

Here is my rewrite.  I interpret your request as follows.  If the
arity of implicit continuations is unspecified we plan to allow both
implementations using implicit continuations which require exactly one
value and those using continuations which accept one or more values.
In particular, if the arity of implicit continuations are unspecified,
some implementations may signal an error when given more than one
value.  As I understand R4RS lingo, I must use the phrase "an error"
to describe situations in which some implementations can signal an
error, and others do not have to.  The phrase "unspecified" means that
no error can be reported which would imply that the arity of implicit
continuations are specified.  Please bless this or suggest an
alternate wording.


(values obj ...)                                        essential procedure

Returns 0 or more values to a receiving procedure (See with-values).

        (values)        =>              returns zero (no) values

        (values 1)      =>              returns a single value, 1

        (values 1 'a) 	=>              returns two values, 1 and the symbol a

Values applied to one argument simply returns its argument.  Returning
more than one value or zero values to something other than a receiving
procedure is an error.

(with-values generator receiver)      			essential procedure

Returns the result of applying the procedure 'receiver' to the values
produced by calling procedure 'generator' with no arguments.  It is an
error if 'receiver' cannot be applied to the number of values returned
by 'generator' or if 'generator' cannot be called with zero arguments.

          (lambda ()
            (values 1 2))
	  cons)   	      =>              (1 . 2)