[Top][All Lists]
[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: |
28 Apr 2004 11:38:20 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> It can be useful when compiling languages other than Emacs Lisp to
> byte code. In my case, I'm writing a Common Lisp compiler, and it
> would be nice to store in the byte code vector things like a closure
> environment, a function name, the original lambda expression, and
> other meta data that Common Lisp can associate with a function object.
I'm beginning to better understand, thank you.
>From your examples, I get the impression that other than the closure's
environment you only need meta-data which can just as well be put in an
alist, so you just need 2 extra slots: one for the closure and one for the
extra slot. Is that right?
Stefan
PS: I'd argue that the closure's enviornment should be put as the first
element in the constants-vector rather than in a separate slot in the byte
code object: it makes closure construction slower and more clostly, but it
makes the function call faster (it's just a normal function call and you can
access the closure's vars directly from the byte code without explicitly
passing them as an extra argument).
Re: User-reserved element in byte code vectors (was: Emacs Common Lisp), Miles Bader, 2004/04/28