Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: updating random slots in (say) defstruct Message-ID: <32964@news.Think.COM> Date: 18 Jan 90 05:12:52 GMT References: <18837@bellcore.bellcore.com> <25B37814.3312@marob.masa.com> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 18 In article <25B37814.3312@marob.masa.com> cowan@marob.masa.com (John Cowan) writes: > (setf (apply accessor (list instance)) newvalue) No, this isn't valid. The first argument to APPLY when it is being used as a SETF place must be a constant. SETF is a macro, so it must know at expansion time what the accessor is so that it can expand into a call to the corresponding updater. >(I have not tested it past one implementation.) If it works, it's due to an implementation extension. It doesn't work on my Symbolics system or in Lucid CL; the latter gives the error "SETF of APPLY is only defined for function args like #'symbol." -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar