emacs-devel
[Top][All Lists]
Advanced

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

Re: User-reserved element in byte code vectors


From: Stefan Monnier
Subject: Re: User-reserved element in byte code vectors
Date: 19 May 2004 11:19:15 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> For what sort of closures?  This currying implementation originated with
> the closures in my lexical-binding implementation -- _after_ I had
> implemented the mechanism for doing closures, I realized that it was
> precisely the same as the currying operator, and so now I called it that,
> as that's a more interesting operation in standard emacs.  But it's the
> same thing as closures for me (not just similar, the same).

I'd be interested to see how you use those `curry' thingies, BTW.
E.g. what does

     (let ((x 0))
       (lambda () (setq x (+ x 1))))

get translated into?

The reason I ask is because a common closure representation is almost the
one you suggested except that instead of

    (funcall #[closure f a1 a2] a3 a4)
      => (f a1 a2 a3 a4)

the reduction rule looks like:

    (funcall #[closure f a1 a2] a3 a4)
      => (f #[closure f a1 a2] a3 a4)

so that the function `f' can modify the vector in order to perform a `setq'
on the free variable.  Of course, the above representation doesn't work
as straightforwardly if the free variable is shared by more than
one closure.


        Stefan




reply via email to

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