On Wed, Jan 08, 2003 at 05:59:14PM +0800, Damian Conway wrote:

> >   my Array @array := SpecialArray.new;
> > 
> > Should the value in @array act like an Array or a SpecialArray?  Most
> > people would say SpecialArray, because a SpecialArray ISA Array.
> 
> Weeeeeell...*I'd* say that @array should act like an Array (that is, you should
> only be able to call the methods specified by the Array class), except that
> any method calls should be polymorphically resolved to invoke the
> equivalent SpecialArray methods.
> 
> But maybe that's just saying the same thing. Is there a linguist in the house?


Will an English major do?

If SpecialArray extends the interface of Array, then these two
statements are not the same; the first statement gives you all of
SpecialArray's functionality while the second statement gives you only
a subset.

--Dks

Reply via email to