From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: space leak from `values' Date: Thu, 29 Jul 2004 18:06:43 +0900 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: Reply-To: Miles Bader NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1091092584 20036 80.91.224.253 (29 Jul 2004 09:16:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Jul 2004 09:16:24 +0000 (UTC) Cc: Dave Love , Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 29 11:16:15 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bq71K-00033I-00 for ; Thu, 29 Jul 2004 11:16:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bq74V-0006Pt-Q1 for ged-emacs-devel@m.gmane.org; Thu, 29 Jul 2004 05:19:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bq74J-0006Pm-GE for emacs-devel@gnu.org; Thu, 29 Jul 2004 05:19:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bq74F-0006PZ-39 for emacs-devel@gnu.org; Thu, 29 Jul 2004 05:19:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bq74E-0006PW-Rw for emacs-devel@gnu.org; Thu, 29 Jul 2004 05:19:15 -0400 Original-Received: from [202.32.8.214] (helo=tyo201.gate.nec.co.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bq70d-0005VD-QU; Thu, 29 Jul 2004 05:15:32 -0400 Original-Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.162] (may be forged)) by tyo201.gate.nec.co.jp (8.11.7/3.7W01080315) with ESMTP id i6T9CrO07022; Thu, 29 Jul 2004 18:14:44 +0900 (JST) Original-Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id i6T9Cri27278; Thu, 29 Jul 2004 18:12:53 +0900 (JST) Original-Received: from edsgm02.lsi.nec.co.jp ([10.50.208.12]) by mailsv3.nec.co.jp (8.11.7/3.7W-MAILSV4-NEC) with ESMTP id i6T98mJ04417; Thu, 29 Jul 2004 18:08:49 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp (localhost [127.0.0.1]) by edsgm02.lsi.nec.co.jp (8.12.10/8.12.10) with ESMTP id i6T98k0K022768; Thu, 29 Jul 2004 18:08:46 +0900 (JST) Original-Received: from mctpc71 (mctpc71.ucom.lsi.nec.co.jp [10.30.118.121]) by mcsss2.ucom.lsi.nec.co.jp (8.12.10/8.12.8/EDcg v2.01-mc/1046780839) with ESMTP id i6T96hwt007604; Thu, 29 Jul 2004 18:06:43 +0900 (JST) Original-Received: by mctpc71 (Postfix, from userid 31295) id 3D588409; Thu, 29 Jul 2004 18:06:43 +0900 (JST) Original-To: storm@cua.dk (Kim F. Storm) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (Kim F. Storm's message of "29 Jul 2004 10:41:42 +0200") Original-Lines: 16 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26086 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26086 storm@cua.dk (Kim F. Storm) writes: >> What's wrong with (setcdr (nthcdr (1- N) LIST) VALUE) ? > > Read the third line of the doc string: > >> If list has less than N elements, do not modify list. > > Your suggestion fails if N is less than the length of the list: It's trivial to handle though that -- just see if the result of `nthcdr' is nil, and only do the `setcdr' if not. Adding a C function for this rather rare operation just seems kinda like pointless bloat... -Miles -- Run away! Run away!