From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai Grossjohann Newsgroups: gmane.emacs.help Subject: Re: lisp performace question: how efficent are (long) list parameters? Date: Wed, 28 Jan 2004 09:05:32 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87k73cebw3.fsf@emptyhost.emptydomain.de> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1075277966 27387 80.91.224.253 (28 Jan 2004 08:19:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2004 08:19:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 09:19:19 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Alkus-0005b0-00 for ; Wed, 28 Jan 2004 09:19:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Alks4-0004Ef-LC for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2004 03:16:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213-203-244-156.kunde.vdserver.DE!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: 213-203-244-156.kunde.vdserver.de (213.203.244.156) Original-X-Trace: news.uni-berlin.de 1075277114 25951092 213.203.244.156 ([73968] 10430) User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:mfPG+Kxnvv47GnFoStjtbwSPjl8= Original-Xref: shelby.stanford.edu gnu.emacs.help:120492 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16438 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16438 leo 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