chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] extending define-values


From: Alex Shinn
Subject: Re: [Chicken-hackers] extending define-values
Date: Mon, 8 Apr 2013 15:34:42 +0900

On Mon, Apr 8, 2013 at 2:54 PM, Felix <address@hidden> wrote:
From: Alex Shinn <address@hidden>
Subject: Re: [Chicken-hackers] extending define-values
Date: Mon, 8 Apr 2013 09:40:02 +0900

> On Mon, Apr 8, 2013 at 6:35 AM, Felix <
> address@hidden> wrote:
>
>> From: Alex Shinn <address@hidden>
>> Subject: Re: [Chicken-hackers] extending define-values
>> Date: Sun, 7 Apr 2013 12:39:43 +0900
>>
>> > On Sat, Apr 6, 2013 at 5:55 AM, Peter Bex <address@hidden> wrote:
>> >
>> >> On Fri, Apr 05, 2013 at 10:49:15PM +0200, Felix wrote:
>> >> > The patch looks ok to me, even though I'm not sure the benefit of
>> having
>> >> > this feature outweights the added complexity, apart from having a
>> little
>> >> > bit of extra consistence.
>> >>
>> >> Note that this makes define-values r7rs-compliant.
>> >> The alternative is to keep the old definition and provide the slightly
>> >> more complicated one in the new "r7rs egg", but I don't know how to make
>> >> the internal definitions syntax stuff extensible.
>> >>
>> >
>> > If you wanted to go this route you could just grab the portable
>> > 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.

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)

etc.

-- 
Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]