Use of change-class interferes with system class default initargs
Attila Lendvai writes:
i wanted to set the default-component-class of our own system subclass using
:default-initargs
, but it's ignored because the slot has a:initform
(as opposed to setting the default value using a:default-initargs
entry).
in the current ASDF setup, i need to override the slot (or the accessor method), which involves messing with internal symbols.
if ASDF used
:default-initargs
then i could just override that using a:default-initargs
entry on my own subclass (IIUC).
This behavior was anomalous, because :default-initargs
is supposed to override :initform
, rather than vice versa.
Further investigation reveals that this is because change-class
is invoked when parsing defsystem
forms. See https://gitlab.common-lisp.net/asdf/asdf/-/blob/master/parse-defsystem.lisp#L447-L453 and https://gitlab.common-lisp.net/asdf/asdf/-/blob/master/system.lisp#L114-L118
This process (I have not investigated further) appears to change the initialization protocol, so that the initforms are clobbering the default initargs.
/cc @alendvai