Re: no overloaded magic??

[prev] [thread] [next] [Date index for 2004/09/15]

From: jason
Subject: Re: no overloaded magic??
Date: 21:03 on 15 Sep 2004
Quoting Perrin Harkins <perrin@xxxx.xxx>:

> On Wed, 2004-09-15 at 16:47, Michael Jensen wrote:
> > % if ($user->group_id < 4) {
> > some stuff here...
> > % }
> >
> >
> >
> > I have never heard of overloading before so I am not sure what isgoing
> > on. See error:
> >
> >
> > Operation `<': no method found,
> > left argument in overloaded package Table::Groups,
> > right argument has no overloaded magic
> > at/home/webtree/home/www.acutext.com/html/o/siteMenu.mas line 45.
>
> Looks like $user->group_id actually returns an object, not a simple
> scalar.  Maybe you meant $user->group_id()->id() ?
>
> - Perrin
>
>

I had frequently run into this problem with fields that are in a has_a
relationship.  If you print them, it stringify's the field, but if you do
comparisons, it will barf.  Perrin's suggestion should do the trick.

-jason scott gessner
    jason@xxxxxxxx.xxx



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

no overloaded magic??
Michael Jensen 20:47 on 15 Sep 2004

Re: no overloaded magic??
Perrin Harkins 20:59 on 15 Sep 2004

Re: no overloaded magic??
jason 21:03 on 15 Sep 2004

Re: no overloaded magic??
Michael Jensen 21:00 on 15 Sep 2004

Re: no overloaded magic??
Tim Bunce 11:22 on 17 Sep 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52