Support for compilation of closures with non-null lexical environment

2 messages Options
Embed this post
Permalink
Erik Huelsmann

Support for compilation of closures with non-null lexical environment

Reply Threaded More More options
Print post
Permalink
The following is valid according to the spec

(locally
   (declare (special x))
   (defun foo () x))
(compile 'foo)

Until today, ABCL would reject compilation of that form (and until
yesterday, it would also reject the fallback: precompilation, btw).

We now support compilation of closures with non-empty environments,
which means that functions defined with variables or special
declarations in their environment can be compiled:

(let ((x 0))
  (defun foo () x)
  (defun goo () (setf x 3)))
(compile 'foo)
(compile 'goo)

(goo)
(foo)
--> 3

It works with symbol macros too.


The next step will be to allow functions bound with flet/labels to be called.


Bye,

Erik.

PS: Alessio showed me we can now do something which LispWorks can't!

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Erik Huelsmann

Re: Support for compilation of closures with non-null lexical environment

Reply Threaded More More options
Print post
Permalink
On Fri, May 22, 2009 at 11:51 AM, Erik Huelsmann <[hidden email]> wrote:

> The following is valid according to the spec
>
> (locally
>   (declare (special x))
>   (defun foo () x))
> (compile 'foo)
>
> Until today, ABCL would reject compilation of that form (and until
> yesterday, it would also reject the fallback: precompilation, btw).
>
> We now support compilation of closures with non-empty environments,
> which means that functions defined with variables or special
> declarations in their environment can be compiled:
>
> (let ((x 0))
>  (defun foo () x)
>  (defun goo () (setf x 3)))
> (compile 'foo)
> (compile 'goo)
>
> (goo)
> (foo)
> --> 3
>
> It works with symbol macros too.
>
>
> The next step will be to allow functions bound with flet/labels to be called.

As off r11926 (which will be delivered as part of 0.15) we also
support FLET/LABELS/MACROLET; I think that means full support as
SYMBOL-MACROLET was already supported by the variable support added
this afternoon.

Well, I hope you enjoy the support!

Bye,

Erik, who now needs to go prepare a release.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel