all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pierre Lorenzon <devel@pollock-nageoire.net>
To: aeuster@gmail.com
Cc: Help-gnu-emacs@gnu.org
Subject: Re: setcdr question
Date: Tue, 02 Jul 2013 04:12:14 +0200 (CEST)	[thread overview]
Message-ID: <20130702.041214.71107046.devel@pollock-nageoire.net> (raw)
In-Reply-To: <1372718770419-290941.post@n5.nabble.com>

From: drain <aeuster@gmail.com>
Subject: setcdr question
Date: Mon, 1 Jul 2013 15:46:10 -0700 (PDT)

> (setq list '(Trevor Jason John Alex Max))
> 
> (setcdr (nthcdr (1- 4) list) 'Christina)
> 
> list
> 
> "list" is now set to:
> 
> (Trevor Jason John Alex . Christina)
> 
> Why is the dot there?
  Because you should have issued :
  (setcdr (nthcdr (1- 4) list) '(Christina)) 

  See how lists are made from cons cell. The cdr should always
  be a list itself or nil at the end.

  Regards 

  Pierre



> 
> 
> 
> --
> View this message in context: http://emacs.1067599.n5.nabble.com/setcdr-question-tp290941.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.
> 



  reply	other threads:[~2013-07-02  2:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01 22:46 setcdr question drain
2013-07-02  2:12 ` Pierre Lorenzon [this message]
2013-07-02  9:06 ` Nicolas Richard
2013-07-02  9:17   ` Teemu Likonen
2013-07-02 22:17     ` drain
2013-07-02 22:26       ` drain
2013-07-03  9:13       ` Pierre Lorenzon
     [not found]       ` <mailman.90.1372804018.12400.help-gnu-emacs@gnu.org>
2013-07-03 13:04         ` Rustom Mody
2013-07-04 19:19           ` drain

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=20130702.041214.71107046.devel@pollock-nageoire.net \
    --to=devel@pollock-nageoire.net \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=aeuster@gmail.com \
    /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.