help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: lisp performace question: how efficent are (long) list parameters?


From: Kai Grossjohann
Subject: Re: lisp performace question: how efficent are (long) list parameters?
Date: Wed, 28 Jan 2004 09:05:32 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux)

leo <leo@bella.local> writes:

> called like `(first-free-position position-alist (frame-list))' this
> version computes (frame-list) only once, but the list `all-frames' is
> put every time on the parameter stack.

Note that in Lisp, a list is just a pointer to a cons cell, and a cons
cell is a pair of pointers.  The car of a cons cell points to the
current list element, the cdr points to the next list element.  The
cdr pointer of the last element is nil.

So what is actually put on the parameter stack is just a pointer to
the first cons cell in the list all-frames.  All calls share the same
list.

Maybe you could read the Emacs Lisp Intro, it has some box-pointer
diagrams illustrating the issue, I think.

Kai


reply via email to

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