the only references to CLASS-PROTOTYPE that specify anything are
"Generic Function class-prototype class
Returns a prototype instance of class. Whether the instance is initialized is not specified. The results are undefined if a portable program modifies the binding of any slot of prototype instance.
This generic function signals an error if class has not been finalized."
and a table that says "No behavior is specified for this method beyond that specified for the generic function." in reference to CLASS-PROTOTYPE on standard-class, funcallable-standard-class, forward-referenced-class, and built-in-class.
So...
I don't see anywhere the requirement for the "prototype instance" to be a direct instance. As a matter of fact, I don't see "prototype instance" specified anywhere. It is blatantly underspecified.
I do think that restricting it to direct instances and signalling an error if we cannot provide one is sensible, so that users can rely on
(bar (class-prototype 'foo))
dispatching on the method specialized on FOO instead of some of its subclasses -- but don't see how this is directly supported by AMOP: it's just the way we decide to interpret the term "prototype instance".
Releated discussion over here:
http://<email address hidden> /msg00158. html
Searching over the online version of AMOP
http:// www.lisp. org/mop/ concepts. html www.lisp. org/mop/ dictionary. html
http://
the only references to CLASS-PROTOTYPE that specify anything are
"Generic Function class-prototype class
Returns a prototype instance of class. Whether the instance is initialized is not specified. The results are undefined if a portable program modifies the binding of any slot of prototype instance.
This generic function signals an error if class has not been finalized."
and a table that says "No behavior is specified for this method beyond that specified for the generic function." in reference to CLASS-PROTOTYPE on standard-class, funcallable- standard- class, forward- referenced- class, and built-in-class.
So...
I don't see anywhere the requirement for the "prototype instance" to be a direct instance. As a matter of fact, I don't see "prototype instance" specified anywhere. It is blatantly underspecified.
I do think that restricting it to direct instances and signalling an error if we cannot provide one is sensible, so that users can rely on
(bar (class-prototype 'foo))
dispatching on the method specialized on FOO instead of some of its subclasses -- but don't see how this is directly supported by AMOP: it's just the way we decide to interpret the term "prototype instance".
status confirmed
importance medium
tags pcl