Christophe Rhodes <csr21@cam.ac.uk> wrote:
+---------------
| rpw3@rpw3.org (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 5.1.2.5.
+---------------
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
5.1.2.5 "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
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607