Re: operator overloading

On Mon, 2003-04-28 at 14:30, Christian Borup wrote:
You need to add fallback => 1, so you'd get.
        use overload '==' => \&G::Object::eq, fallback => 1;


so, yeah, i added an overloaded == operator for G::Objects, so that
things like

      if ($widget->child == $otherwidget) {
           # do cool stuff

now work properly instead of requiring the cumbersome and ugly

      if ($widget->eq ($otherwidget)) {

syntax.  committed earlier this evening.  then i went to see
"bulletproof monk", and am convinced that i need to learn to fly like
chow yun fat.

muppet <scott at asofyet dot org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]