Subject: Re: aref with N dimension arrays
From: (Rob Warnock)
Date: Wed, 08 Mar 2006 03:23:06 -0600
Newsgroups: comp.lang.lisp
Message-ID: <>
Christophe Rhodes  <> wrote:
| (Rob Warnock) writes:
| > Try this:
| >     (setq (apply #'aref array-1 '(0 0 0)) (apply #'aref array-2 '(0 0 0)))
| > It works fine on CMUCL, though I'm not sure it's required to...
| The main thrust of your solution (the use of (SETF APPLY)) is required
| to work on AREF ...  See CLHS

Ahhh, thanks 1d6! I am continually learning more bits of CL here.
I had previously read most of 5.1.2 "Kinds of Places", but not "APPLY Forms as Places" until just now.

| I assume the SETQ (both here and in the OP) is a typo.

I'll let OP speak for himself, but mine certainly was. (*blush*)
After going to all of the trouble of verifying a working example
in another window [using SETF, of course], I copy&pasted the OP's
original text and then just added in the "apply #'" prefixes,
unfortunately failing to notice the SETQ. Mea culpa.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607