[Openmcl-devel] Getting inside a compiled-lexical-closure

Sven Van Caekenberghe sven at beta9.be
Wed May 19 06:26:53 PDT 2004


On 19 May 2004, at 13:18, Gary Byers wrote:

> ? (let ((a-list '(1 2 3))) (defun foobar (x) #'(lambda ()
>                                                (append x 
> (list-all-packages) a-\
> list))))
> FOOBAR
> ? (show-uvector #'foobar)
> 0: #<CODE-VECTOR #x10104D6>
> 1: #<Compiled-function FOOBAR (Non-Global)  #x536C86E>
> 2: (1 2 3)
> 3: NIL
> 4: 16777216
>
> The number of closed-over/inherited values in a clozure is its UVIZE - 
> 4
> (1 in the example above)

Magic once again, I saved the show-uvector in a file for later hacking 
(when describe/inspect fail or fall short).

Thx,

Sven





More information about the Openmcl-devel mailing list