[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
An example of where setf does not do what I want.
- To: Bradley C. Kuszmaul <bradley@Think.COM>
- Subject: An example of where setf does not do what I want.
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Fri, 12 Sep 86 13:27 EDT
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: <8609121011.AA17090@Godot.Think.COM>
Date: 12 Sep 86 06:11:02 EDT (Fri)
From: Bradley C. Kuszmaul <bradley@Think.COM>
I want to do
(setf (apply #'aref (cons my-array dims)) value)
where MY-ARRAY, DIMS, and VALUE are bound to meaningful values
Unfortunately, my reading of SETF says that the above won't work.
If I had (ASET value array &rest dims) then I could to
(apply #'aset (list* value my-array dims))
to do what I want.
Recall that APPLY in Common Lisp allows more than two arguments,
unlike APPLY in traditional languages such as Maclisp, Zetalisp,
and Lisp 1.5. Hence the expansion is
(APPLY #'aset VALUE (CONS MY-ARRAY DIMS))
where aset is not a standard Common Lisp function, but we all know
what it does.