At 04:51 PM 8/11/00 +0100, Graham Barr wrote:
>On Fri, Aug 11, 2000 at 10:54:43AM -0400, Dan Sugalski wrote:
> > At 03:28 PM 8/11/00 +0100, Graham Barr wrote:
> > >On Fri, Aug 11, 2000 at 10:20:55AM -0400, Dan Sugalski wrote:
> > > > I think we're going to have to have a doubly-linked list going for
> > > @ISA, so
> > > > when a parent package changes the child packages get changed too. It'll
> > > > make updates to @ISA more expensive, but if you do that then you
> ought to
> > > > be prepared to take a hit.
> > >
> > >You mean each package has a "I am inherited by" list which you could
> > >follow to change the cache entries. Hm, interesting...
> >
> > Yup. Makes life easier in some ways, since you can propagate the changes.
> > It also moves the expense of the update to the place the change is made,
> > rather than forcing all sorts of ambiguity resolution code on the bits
> that
> > do the lookups.
> >
> > We'll know the inheritance hierarchy, and we'll know the contents of the
> > package stash, so we can make sure markers ripple upwards. When an
> > inherited package is changed we can propagate the changes.
> >
> > That way, method lookup resolves to:
> > use package method;
> > if package method doesn't exist, start the AUTOLOAD calling sequence.
>
>Are you also suggesting that when @ISA is assigned that you look in the
>packages we inherit from an create the sub-class cache then for all
>sub ?
It was a thought, yes.
>While it would make method lookup faster, it's only benefit over the current
>method is faster lookup of the first call to a method but at the cost
>of extra processing at startup time to cache methods that may never be used.
Good point. Never mind--not worth it. Clearing out the cached methods makes
sense, rebuilding the cache doesn't. If someone really wants, I suppose we
could provide a method to allow this somehow. I can see front-loading the
expense being worth it occasionally. I think.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk