In the hunchentoot source code, there is an :after defmethod called initalize-instance.
This particular example is one of a handful of :after methods called initalize-instance throughtout the project.
My experience with CLOS taught me that a primary method is required for :before, :after and :around methods can be used.
But in the hunchentoot package, I cannot see how they have created the primary methods to allow the :after methods to work.
What am I missing?
The symbol
initalize-instanceis in theCOMMON-LISPpackage. It is one of the generic functions provided by the standard. If you check this generic function, you'll find that it has many methods. There is also a matching primary method. Methods can be declared anywhere, they don't need to be in a particular file.The method combination for
initialize-instancewith an object of classmy-classlooks like this:The primary method for
STANDARD-OBJECTis system provided.Above shows that the instance is also of class
standard-object, becausestandard-objectis a superclass ofmy-class.The class
standard-objectis a superclass of the classmy-class.