help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setcdr question


From: Pierre Lorenzon
Subject: Re: setcdr question
Date: Tue, 02 Jul 2013 04:12:14 +0200 (CEST)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]