Stefan Monnier writes: Hi Stefan, > The current handling of map-put on lists is very ad-hoc: > The gv-expander of `map-elt` tests if the arg is a list and if so > delegates to `alist-get`. > > It kind of works, but for a library that's supposed to be generic and > expandable to other map types, this is undesirable. > > So in the patch below I change this such that `map-elt` does not special > case lists any more. Instead `map-put!` is changed to signal a special > error when it can't do its job, and the gv-expander of `map-elt` catches > this error and delegates the job to a new non-side-effecting > `map-insert`. > > With this, we can add new map types via defmethod that work like lists > (i.e. that don't support inplace update but can still be modified via > `setf`). > > WDYT? I think it's a good step forward, thank you. I'd like to start thinking about adding support for plists in map.el. nico