On Fri, Jun 29, 2001 at 08:59:59AM -0400, John Porter wrote:
> Michael G Schwern wrote:
> > Second, and perhaps more importantly, we can do this perfectly well
> > with a module.  No hacks, no tricks, no filters.
> > Class::Object uses the mini-class technique (ie. auto-generated
> > classes 
> 
> Sorry, that sounds like a hack/trick if ever there was one.
> I would sure hope there would be a cleaner way to do it in
> perl6, if it's not part of the core language.

Maybe, but I think it is the way to do it, even if it is behind
the scenes.

My reason for that is method lookup. Right now we use the package (class)
stash as a cache so we don't have to search @ISA for every method call.
But if there is a case where not all objects that inherit from a given class
have the same superclasses, you cannot do this. This means that we will either
burn a lot more memory for the caches or method lookup will take longer.

> It's also not without its faults.  Having every instance of a
> class have different values of ref() could be obnoxious, for
> example.

That could be preserved by the object holding a pointer to it's blessed
stash and its method stash, which for the most case will be the same.

Graham.

Reply via email to