Dylan initialization protocol

I have been stuck on KLOS because TinyCLOS’s initialization protocol is different from Dylan’s and I got snarled up in the handling of keywords and initargs.

I did some reading last night and here are my notes.

The initialization protocol for Dylan is actually documented in the DRM.

Basically this needs to be implemented:

The default make method allocates an instance and initializes all the slots for which it can provide values, as follows:

  • If the slot is keyword initializable and its keyword is present in the defaulted initialization arguments, then the slot is initialized from the defaulted initialization arguments.

  • If the slot is not initialized by a keyword but has an init specification, it is initialized from the init specification.

  • In either case, an error of type is signaled if the value is not of the type declared for the slot.

  • Regardless of the source, the initial value is stored into the slot using an unspecified built-in mechanism. In particular, the setter generic function is not called to store the value into the slot.

I found some of the old implementation in Common Lisp here.

There was an attempt of a Dylan Scheme system called IDyl, this is how it handles initargs.