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

Re: Can I OVERLOAD the assignment operator? Please???

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
May 22, 2003 13:18
Subject:
Re: Can I OVERLOAD the assignment operator? Please???
Message ID:
a05210607baf2e08383a8@[63.120.19.221]
At 10:05 AM -0400 5/22/03, John Peacock wrote:
>
>So, before I start digging in the code, let's have the argument 
>[again] why overloading the assignment operator is a bad thing.

You already can overload the assignment operator. That's what tie is.

Overloading as it stands now works on the value, while tying works on 
the variable. (a contents vs container thing) Overload is a value 
thing, tying a container thing. Assignment is an operation on the 
variable rather than the value, so it should live in the world of 
tying, not overloading.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk

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