in reply to Are array based objects fixed length?

If I understand it correctly, Pixie is taking a random object and trying to stuff information in it?

You are doomed, man, you are doomed. But that's your own fault, because you break a cardinal rule of OO programming: encapsulation. Don't poke around in someone elses implementation.

If you think array based objects are a problem, how do you want to deal with scalar based objects? Or filehandle based objects, like some (all?) of the IO:: classes?

Of course, you are not free of problems with hash based objects either. Such an object might have already a "__Pixie" attribute. Or it has an overloaded stringify that's going to do something with all the key/value pairs. Not to mention all the existing techniques out there that prevent accessing/setting keys that aren't in a predefined set.

Abigail

  • Comment on Re: Are array based objects fixed length?

Replies are listed 'Best First'.
Re: Re: Are array based objects fixed length?
by pdcawley (Hermit) on Jul 26, 2002 at 12:37 UTC
    Oh, I know. The idea is to come up with a sufficiently useful set of assumptions about the stored objects that will offer a useful set of behaviours. And those assumptions will be documented so users will be aware of the issues. The next step after that is to provide hooks so objects can, if necessary be complicit with Pixie.

    Encapsulation is overrated anyway. Hell, even Smalltalk, the granddaddy of OO systems, provides tools (inspectors, browsers...) to get round encapsulation.