[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting the nth element of a list
From: |
Barry Margolin |
Subject: |
Re: Setting the nth element of a list |
Date: |
Fri, 05 Jun 2009 16:51:37 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article
<b775c362-a37c-4d38-bce1-8de6922acbd3@b1g2000vbc.googlegroups.com>,
Nordlöw <per.nordlow@gmail.com> wrote:
> How do I accomplish the same with arrays? Using aref I guess. Here is
> my mockup that doesn't yet do what I want:
>
> (defun setnthref (n array x)
> "Set N:th element of ARRAY to X for side effects only."
> (set (aref array n) x))
There's already a built-in function aset that does exactly that, except
it takes its arguments in a different order. Why do you need your own
function?
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
- RE: Setting the nth element of a list, (continued)
- RE: Setting the nth element of a list, Drew Adams, 2009/06/04
- Re: Setting the nth element of a list, Lennart Borgman, 2009/06/04
- 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 <=