develooper Front page | perl.perl5.porters | Postings from January 2000

Re: On Pseudohashes

Tim Bunce
January 17, 2000 05:46
Re: On Pseudohashes
Message ID:
On Mon, Jan 17, 2000 at 06:30:46AM -0700, Tom Christiansen wrote:
> I'm not sure, but I think I was just worried about figuring out
> whether a particular assignment was legal:
>     my Dog $spot = frobnicate();
> But that doesn't matter.  All you care about is whether the methods
> invoked against whatever happens at run time to have taken up
> residence in the $spot variable.  So long as that class's @ISA and
> package symbol table are populated at compile-time with the same
> data as they'll ever hold at run-time, you could do the check.
> Likewise recursively for parent classes.
> The presence of an AUTOLOAD anywhere in the graph seems to make
> compile-time validation pointless.

It's always been advisable for classes to pre-declare all their methods
if using AUTOLOAD.

Tim. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About