4 ms·
> A function per slot written inside the module that owns the symbols? Yes, usually you define accessors/readers for the slots that you want to be available to
by juki 5y ago
> A function per slot written inside the module that owns the symbols?
Yes, usually you define accessors/readers for the slots that you want to be available to others. An accessor is basically a function that can be used like a variable, but allows arbitrary code to run when getting/setting it (this is important to allow macros to be written without having to constantly worry about whether something is a function call or a variable). The `defclass` macro has an option to automatically generate accessors, readers or writers for the simple case (just directly reading/writing the slot), but you can also define more complex ones by hand.
You could of course also export the symbol to allow direct access to the slot, but accessors are the typical choice.