|
From: | Alex Shinn |
Subject: | Re: [Chicken-hackers] extending define-values |
Date: | Tue, 9 Apr 2013 06:33:48 +0900 |
>> >> > If you wanted to go this route you could just grab the portable"define-values" can not simply expand into a bunch of "defines". To
>> >> > reference implementation of define-values, no need to touch
>> >> > internals.
>> >>
>> >> This wouldn't work for internal definitions, I think. Is "define-values"
>> >> allowed for local definitions in R7RS?
>> >>
>> >
>> > It's just syntax which expands into internal definitions.
>> > The only way it could not work is with an implementation
>> > which looks for internal defines statically before expanding
>> > the lambda body.
allow it to be intermixed with "define" in internal definitions, it
needs be special cased, due to the use of "call-with-values" (which
would "break" the sequence of definitions and treat all following
forms of the body as non-definitions). Or not? At least I can't
think of any other solution than treating it explicitly.
BTW, where can I find the portable reference implementation you
mentioned?
>>Yes, I've heard of that before. What about
>> What about detection for redefinitions of defining forms
>> ("define-values" in this case)? Wouldn't that need special handling?
>>
>
> That's an error according to the standard, section 5.4:
>
> "... it is an error for a definition to define an identifier whose
> binding has to
> be known in order to determine the meaning of the definition itself..."
>
> with the standard R5RS error examples including
>
> (define define 3)
>
(define-values define-values 3)
?
[Prev in Thread] | Current Thread | [Next in Thread] |