At 6:35 PM +0000 1/13/03, Piers Cawley wrote:
Dan Sugalski <[EMAIL PROTECTED]> writes:

 At 1:10 PM +0000 1/6/03, Piers Cawley wrote:
Dan Sugalski <[EMAIL PROTECTED]> writes:
  An object is a data type, as much as an array or hash is a data type,
  but that doesn't make an array an object. [insert obligatory "all men
  are Socratese" quote here)
I really hope you're wrong here Dan. At least in that particular
case. Being able to inherit from Array or Hash or whatever as a
neater way of implementing, say, Tie semantics would be remarkably useful...
 Well, you'll certainly be able to use delegation to get in the way if
 nothing else.
Go on, how would delegation help in the case where you want to be
subclass Array so as to be able to do:

    my TiedArraySubclass @foo;
Then (assuming that Larry either approves of or doesn't notice my Evil Plans) @foo is a variable of type TiedArraySubclass, which had best have a vtable capable of dealing with keyed access. How it does this, by completely reimplementing an array form, or acting as a layer on top of the base array implementation that it redispatches to is up to whoever implements TiedArraySubclass. Presumably, from the name, there wouldn't actually be a real array under the hood, but there certainly could be.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk

Reply via email to