[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting the nth element of a list
From: |
Lennart Borgman |
Subject: |
Re: Setting the nth element of a list |
Date: |
Fri, 5 Jun 2009 00:35:06 +0200 |
Use nthcdr
On Thu, Jun 4, 2009 at 11:08 PM, Nordlöw <per.nordlow@gmail.com> wrote:
> 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
>
- Setting the nth element of a list, Nordlöw, 2009/06/04
- RE: Setting the nth element of a list, Drew Adams, 2009/06/04
- Re: Setting the nth element of a list,
Lennart Borgman <=
- Re: Setting the nth element of a list, Barry Margolin, 2009/06/04
- Re: Setting the nth element of a list, Nordlöw, 2009/06/05
- Re: Setting the nth element of a list, Nordlöw, 2009/06/05
- Re: Setting the nth element of a list, Pascal J. Bourguignon, 2009/06/05
- Re: Setting the nth element of a list, Nordlöw, 2009/06/05
- Re: Setting the nth element of a list, Pascal J. Bourguignon, 2009/06/05
- Re: Setting the nth element of a list, bigfaceworm, 2009/06/05
- Re: Setting the nth element of a list, Miles Bader, 2009/06/06
- Re: Setting the nth element of a list, Barry Margolin, 2009/06/05