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

Re: On Pseudohashes

From:
Tim Bunce
Date:
January 17, 2000 05:46
Subject:
Re: On Pseudohashes
Message ID:
20000117134432.I12453@ig.co.uk
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.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About