unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Why doesn't nconc change my variable?
@ 2014-10-05  1:36 Marcin Borkowski
  2014-10-05  1:58 ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Marcin Borkowski @ 2014-10-05  1:36 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Hi list,

I don't get it.

(setq my-list ())
(nconc my-list '("wtf"))

and my-list is still nil.

If, OTOH, I do

(setq my-list ())
(setq my-list (nconc my-list '("wtf")))

my-list is ("wtf").

Why is that so?  I though nconc is supposed to change all its arguments
but the last one.  Is the latter construct a correct way of adding an
element at the end of the list?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <mailman.10460.1412473030.1147.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2014-10-05 18:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-05  1:36 Why doesn't nconc change my variable? Marcin Borkowski
2014-10-05  1:58 ` Drew Adams
2014-10-05  9:54   ` Marcin Borkowski
2014-10-05 10:52     ` Thorsten Jolitz
2014-10-05 16:29     ` Drew Adams
2014-10-05 16:38       ` Drew Adams
     [not found]   ` <mailman.10475.1412502895.1147.help-gnu-emacs@gnu.org>
2014-10-05 18:12     ` Pascal J. Bourguignon
2014-10-05 18:14     ` Pascal J. Bourguignon
2014-10-05 18:31     ` Pascal J. Bourguignon
     [not found] <mailman.10460.1412473030.1147.help-gnu-emacs@gnu.org>
2014-10-05  1:59 ` Pascal J. Bourguignon
2014-10-05  9:35   ` Marcin Borkowski
     [not found]   ` <mailman.10474.1412501757.1147.help-gnu-emacs@gnu.org>
2014-10-05 17:50     ` Pascal J. Bourguignon
2014-10-05 18:04 ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).