From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: setcdr question Date: Tue, 02 Jul 2013 11:06:58 +0200 Message-ID: <87obal1gb1.fsf@yahoo.fr> References: <1372718770419-290941.post@n5.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372756052 10128 80.91.229.3 (2 Jul 2013 09:07:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jul 2013 09:07:32 +0000 (UTC) Cc: Help-gnu-emacs@gnu.org To: drain Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 02 11:07:32 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UtwYd-0000O5-9m for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jul 2013 11:07:31 +0200 Original-Received: from localhost ([::1]:39902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtwYc-00076D-GU for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jul 2013 05:07:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtwY7-0006jr-R4 for Help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 05:07:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtwY5-0005GO-0y for Help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 05:06:59 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:23104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtwY4-0005FE-RV for Help-gnu-emacs@gnu.org; Tue, 02 Jul 2013 05:06:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAM6V0lGkD4Nx/2dsb2JhbABaw1GBEXSCJAEFeRAIAyElDwEEDTwTh3wBAw+qdIc5AUoNiFKMcYJpB4NrA5VigWeGDoYShSWDEzo Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 02 Jul 2013 11:06:55 +0200 In-Reply-To: <1372718770419-290941.post@n5.nabble.com> (drain's message of "Mon, 1 Jul 2013 15:46:10 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91902 Archived-At: drain writes: > (setq list '(Trevor Jason John Alex Max)) > (setcdr (nthcdr (1- 4) list) 'Christina) As your question was already answered, I allow me to digress slightly in suggesting that you may like setf for such operations: (let ((list '(Trevor Jason John Alex Max))) (setf (nth (1- 4) list) 'Christina) list) => (Trevor Jason John Christina Max) -- Nico.