guile-user
[Top][All Lists]
Advanced

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

Re: Closure?


From: Ludovic Courtès
Subject: Re: Closure?
Date: Tue, 15 Jul 2008 09:59:04 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Hello,

"Neil Jerram" <address@hidden> writes:

> 2008/7/11 Kjetil S. Matheussen <address@hidden>:
>>
>> On Fri, 11 Jul 2008, Kjetil S. Matheussen wrote:
>>
>>> Ludovic Court?s:
>>> >
>>> >  guile> ((lambda (a b) (the-environment)) 2 3)
>>> >  (((a b) 2 3) #<eval-closure b7c6dcf8>)
>>> >
>>> > But don't do that, since the representation of environments could
>>> > eventually change.
>
>> Sorry, I misunderstood. What I ment is that (the-environment)
>> etc. is what makes Guile special. I hope there is no
>> plans to remove all that.
>
> I agree.  I can't see a reason why we might want to remove
> `the-environment' and `local-eval', even if Guile's internal
> representation of environments changes, because the ideas that there
> _is_ a lexical environment inside a lambda (or a let ...), and that
> one can evaluate with respect to these environments, are absolutely
> fundamental in Scheme.

Agreed.  I just said the *representation* of closures could change.

(Besides, keep in mind that `the-environment' et al. aren't
documented...)

> On the other hand, it would be unsafe (w.r.t. the future) to write
> code that depends on the current representation.  If you find yourself
> doing that, better to ask for an official abstraction of whatever
> you're trying to do.  (And even better to provide a patch for it!)

Agreed.

Thanks,
Ludovic.





reply via email to

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