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

Re: overloading = [a solution]

Thread Previous | Thread Next
From:
Damian Conway
Date:
May 5, 2000 16:42
Subject:
Re: overloading = [a solution]
Message ID:
200005052342.JAA05248@indy05.csse.monash.edu.au
   > > This is orthogonal to typed lexicals.
   > 
   > But not orthogonal to PREPARE.
   > 
   > > Typed lexicals aren't enough on their own. Specifically, they won't stop
   > > type-incompatible assignments that introduce subtle bugs:
   > > 
   > > 	my Dog $snoopy;
   > 
   > PREPARE ties $snoopy to Dog::Tie...
   > 
   > > 	$snoopy = Alligator->new();
   > 
   > Dog::Tie::STORE catches the problem.

Okay. TMTOWTDI. The advantage of Class::ifiedVars is Laziness: you don't
need to set up the Dog::Tie class (and the Cat::Tie class, and the
Goldfish::Tie class...). Oh, and it works just as well on package variables.

Damian

Thread Previous | Thread Next


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