[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inheritance of Methods

I agree with the following statement:

                    a subclass inherits methods in the sense that any method
    applicable to an instance of a class is also applicable to instances of
    any subclass (all other arguments to the method being the same).  For
    methods that have only one specialized argument, for example the
    accessors of a class, we say that subclasses inherit the use of those
    methods from the super class.

I do not agree that we should say that. I think it is forcing an
inappropriate metaphor too far.

On a related topic. Suppose C1 is a class with a slot named FOO and an
accessor method, C2 is a subclass with FOO subtracted out (the :allocation
is :none for that slot), and suppose that C3 is a subclass of C2 without
an accessor method.

Does the accessor method for FOO work on instances of C2? Of C3? Are
errors signalled?