From: Marco Antoniotti
Subject: setf methods for structure accessors used as parameters
Date: 
Message-ID: <9212222057.AA11609@IMAGE.CS.NYU.EDU>
Hello there,

I am writing some code (priority queues) that uses a :key argument to
extract information from some structure. The value passed as a :key
argument is always funcalled within the code. At a certain point I
need to actually 'setf' the structure slot 'keyed' by the :key value.
I.e. I have code that looks like

(defun maximize (x &key (key an-x-accessor))

	...

	(funcall an-x-accessor x)
)

and I want to be able to do something like


(defun do-maximize (x &key (key an-x-accessor))

	...

	(setf (an-x-accessor x) somevalue)
)

I checked CLtL2, but I couldn't come up with anything reasonable. I
have a hunch that it is not possible.

Any idea?

Marco