in reply to Re: Re: Re: Re: Re: Re: Symbol table globbing from object refs
in thread Symbol table globbing from object refs

I just realized that I have been misunderstanding your proposal.

You think that whoever implements an AUTOLOAD should implement a can method in their own class that will indicate whether or not AUTOLOAD in that class will provide a given method, and then allows you to go to the NEXT class if it does not. (The amount of time that Perl went without a proper NEXT implementation is an example of why I don't assume that people will get multiple inheritance right.)

I thought that you thought that UNIVERSAL::can should be overrided like broquaint suggested so that an AUTOLOAD should be assumed to provide every method. Which is a simply horrible idea.

I still don't like your approach, but I dislike it less. My reason for disliking it is that you are making it darned easy for duplication of logic to happen, all to improve an (at this point pretty badly) broken assumption that can should see methods provided by AUTOLOAD. Trusting lots of different people to get something right is likely to break. Particularly if it isn't something currently being widely done. As evidenced by docs and current CPAN code. Heck, even core modules like AutoLoader don't think about can.

And what I don't trust will be done reliably, I prefer not to trust at all no matter how convenient it might be if it actually worked.

(Of course my tendancy is to write code to install many similar subroutines dynamically rather than lazily do it with AUTOLOAD. Which sidesteps the issue in another way)

  • Comment on Re: Re: Re: Re: Re: Re: Re: Symbol table globbing from object refs