unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting the nth element of a list
@ 2009-06-04 21:08 Nordlöw
  2009-06-04 22:06 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Nordlöw @ 2009-06-04 21:08 UTC (permalink / raw)
  To: help-gnu-emacs

This simple example changes the second element in the list x:

(setq x '(a nil c))
(setcar (cdr x 'b)

How do I generalize this to a function that sets (changes) the nth
element of a list (for side effects only)?

Thanks in advance,
Nordlöw


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-06-06  6:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-04 21:08 Setting the nth element of a list Nordlöw
2009-06-04 22:06 ` Drew Adams
2009-06-04 22:35 ` Lennart Borgman
2009-06-05  2:25 ` Barry Margolin
2009-06-05 13:06   ` Nordlöw
2009-06-05 13:10     ` Nordlöw
2009-06-05 13:25       ` Pascal J. Bourguignon
2009-06-05 13:57         ` Nordlöw
2009-06-05 15:08           ` Pascal J. Bourguignon
2009-06-05 16:56           ` bigfaceworm
2009-06-06  6:01             ` Miles Bader
2009-06-05 20:51     ` Barry Margolin

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).