[Top][All Lists]

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

Re: User-reserved element in byte code vectors

From: Lars Brinkhoff
Subject: Re: User-reserved element in byte code vectors
Date: 02 May 2004 20:59:18 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Stefan Monnier <address@hidden> writes:
> > > 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 costly, but it makes the function call faster.
> > The downside to that is that you would have to create both a new
> > byte code object, and a new constants vector every time a closure
> > is created.
> Yes, as I said above, "it makes closure construction slower and more
> costly".  But it does make calling a closure faster since closures
> are then plain old normal byte-code objects supported natively
> whereas in your case you need to do some massaging before doing the
> actual `funcall'.

No, that's not necessary.  As long as the first six element in the
byte code object are as Emacs expects them to be, anything can be
stuffed into additional elements.  At least in GNU Emacs 20.7, 21.3,
and CVS.

> Furthermore, with your scheme you can't call closures in the same
> way as built-in functions.  How do you deal with that without
> slowing down function calls or closure construction too much?

A closure can be a byte code object with an extra element.

Lars Brinkhoff,         Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting    http://www.brinkhoff.se/

reply via email to

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