From: Miles Bader <miles@lsi.nec.co.jp>
Cc: Dave Love <d.love@dl.ac.uk>,
Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org
Subject: Re: space leak from `values'
Date: Thu, 29 Jul 2004 18:06:43 +0900 [thread overview]
Message-ID: <buo3c3bgp24.fsf@mctpc71.ucom.lsi.nec.co.jp> (raw)
In-Reply-To: <m33c3bdx2x.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "29 Jul 2004 10:41:42 +0200")
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!
next prev parent reply other threads:[~2004-07-29 9:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <rzqzn5qehby.fsf@albion.dl.ac.uk>
[not found] ` <E1BoSQg-0001Br-II@fencepost.gnu.org>
[not found] ` <rzq3c3eex5r.fsf@albion.dl.ac.uk>
[not found] ` <E1Bp9wv-0004v0-Ts@fencepost.gnu.org>
[not found] ` <rzqllh4m4yi.fsf@albion.dl.ac.uk>
[not found] ` <jwvu0vs9gjz.fsf-monnier+emacs@gnu.org>
2004-07-28 23:13 ` space leak from `values' Kim F. Storm
2004-07-29 7:50 ` Miles Bader
2004-07-29 8:41 ` Kim F. Storm
2004-07-29 8:50 ` David Kastrup
2004-07-29 9:06 ` Miles Bader [this message]
2004-07-29 12:00 ` Kim F. Storm
2004-07-30 16:16 ` Richard Stallman
2004-08-20 12:51 ` Kim F. Storm
2004-08-21 16:49 ` Richard Stallman
2004-07-30 4:54 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=buo3c3bgp24.fsf@mctpc71.ucom.lsi.nec.co.jp \
--to=miles@lsi.nec.co.jp \
--cc=d.love@dl.ac.uk \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.