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

Re: [Scheme-reports] procedure identity

On Wed 05 Jun 2013 13:08, Alaric Snell-Pym <alaric@x> writes:

> "lambda" is a construct that, when evaluated, gathers the closed-over
> variables and allocates a closure-thing and puts them in along with
> the hardcoded code pointer.

This is not the case :)  Lambda is an abstraction that may or may not
correspond to an object at runtime.

> It may or may not make sense to deduplicate operationally equivalent
> closures - that have the same (or equivalent in some other way) code
> pointers, and eqv? closed-over variables, and that don't set! their
> variables so they will remain eqv?.

For implementations that use environments, you just compare the code
pointer and the environment.

For implementations with flat closures, you compare the code pointer and
each captured variable.  (Mutated variables are captured in a box.)

Just sayin'.


Scheme-reports mailing list