Common-lisp seems to provide "generalized variables" to allow programmatic access to places in addition to names (of variables). As a simple example,
(setf (get 'object :property1) (1+ (get 'object :property1)))
increments the value at the place (get 'object :property1)
. However, there are also destructive macros like (incf (get 'object :property1))
that can do the same thing more concisely, as the place only needs to be mentioned once. The same pattern occurs whenever the new value is a function of the old value at some place. When the place accessor is complex, the redundancy can get verbose and difficult to readily grasp (at least for me). I would like to know a macro schema for writing my own destructive macros for changing such values, when the new value is some function of the old value. I note that it isn't a simple matter of passing in a function, since the accessor may be embedded in an arbitrary number of function calls or other lisp object.