From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: leo Newsgroups: gmane.emacs.help Subject: lisp performace question: how efficent are (long) list parameters? Date: 11 Jan 2004 03:35:04 +1100 Organization: Netspace Internet Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073753240 10788 80.91.224.253 (10 Jan 2004 16:47:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Jan 2004 16:47:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 10 17:47:12 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 1AfMGV-0005fC-00 for ; Sat, 10 Jan 2004 17:47:11 +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 1AfND3-0002oz-V5 for geh-help-gnu-emacs@m.gmane.org; Sat, 10 Jan 2004 12:47:41 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!hermes.visi.com!news-out.visi.com!petbe.visi.com!news1.optus.net.au!optus!news.mel.connect.com.au!news.netspace.net.au!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: dsl-203-33-162-54.nsw.netspace.net.au Original-X-Trace: otis.netspace.net.au 1073752506 70067 203.33.162.54 (10 Jan 2004 16:35:06 GMT) Original-X-Complaints-To: usenet@otis.netspace.net.au Original-NNTP-Posting-Date: Sat, 10 Jan 2004 16:35:06 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:119959 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:15901 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15901 hi there just a little thing for a lisp beginner. i have written a function: (defun first-free-position (positions) "returns the first free position in POSITIONS of all frames" (if positions (let ((list-of-frames (frame-list))) (if (frame-on-position (car positions) list-of-frames) (first-free-position (cdr positions)) (car positions))))) this function recomputes `(frame-list)' for every recursion. so i thought to set `(frame-list)' to a variable which could be carried through as parameter: (defun first-free-position (positions all-frames) "returns the first free position in POSITIONS of all-frames." (if positions (if (frame-on-position (car positions) all-frames) (first-free-position (cdr positions) all-frames) (car positions)))) 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. so, what is more effiecent? cheers, leo