chiark / gitweb /
Replace the `init' class-slot function with an `init' message.
The `SodObject' class now defines an `init' message. This message takes
keywords, which can be collected by methods and used to set up objects
in interesting ways.
The `init' message's default behaviour (unless overridden by a primary
or around method) is to initialize the instance's slots using the most
specific applicable initializers, just as the old `init' function used
to do.
Obviously, one can send an `init' message to an instance before it's
been imprinted, so that has to be done as a separate step now. The
`SOD_DECL' macro has been adjusted to cope. It also takes an additional
argument containing keyword arguments to be passed with the `init'
message (which constitutes an additional compatibility break).
The library has grown a new pair of functions `sod_init' and `sod_initv'
which wrap up the initialization protocol, and a macro `SOD_INIT' which
improves type safety a little.
(Some of the new code in `src/builtin.lisp' is a little odd. This is
intended to accommodate future changes better.)
12 files changed: