[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Stray Birds
Date: Tue, 2 Mar 93 00:36:14 -0500
From: "Guillermo J. Rozas" <gjr@martigny.ai.mit.edu>
Reply-To: gjr@martigny.ai.mit.edu
Date: Mon, 1 Mar 93 19:59:14 PST
From: kend@newton.apple.com (Ken Dickey)
At 7:56 PM 93/03/01 -0500, Guillermo J. Rozas wrote:
>I haven't used the HL macros, but what is wrong with the following
>(besides "exporting" define-values-helper) as a _reference_
>implementation
>
>(define-syntax DEFINE-VALUES
> (syntax-rules
> ()
> ((define-values (<name> ...) <body> ...)
> (begin
> (define <name> #f) ...
> (call-with-values
> (lambda () <body> ...)
> (lambda all-the-values
> (define-values-helper all-the-values <name> ...)))))))
My recollection is that the receiver in a call-with-values form has to
accept the exact number of values returned by the thunk. I certainly think
that it *should* be the rule... Anyone?
-Ken kend@newton.apple.com
It does accept them. It accepts any number!
I think the agreement was that the implicit application in
call-with-values should be no more or no less strict than the
application in a procedure call.
Thus, since lambda expressions with symbols for argument lists
generate procedures that take any number of arguments, the
continuation created by call-with-values above should be able to
accept any number of values.
The above is not the agreement on multiple values as I understood it.
I distinctly remember us stating that "it is an error" to supply too
many or too few values. Since it is not required that an
implementation "signal an error", the above implementation is correct,
albeit probably not desirable.
--------------------
Morry Katz
katz@cs.stanford.edu
--------------------
- Follow-Ups:
- Stray Birds
- From: "Guillermo J. Rozas" <gjr@martigny.ai.mit.edu>
- References:
- Stray Birds
- From: "Guillermo J. Rozas" <gjr@martigny.ai.mit.edu>