Re: Object Order of Precedence (Was: Vocabulary)

2003-12-19 Thread Luke Palmer
Larry Wall writes: > But if you say something like: > > class DangerousPet does Pet does Predator { > multi method feed ($x) {...} > } > > then DangerousPet::feed is called only when multimethod dispatch > would have thrown an exception. Alternately, multi's will probably have > so

Re: but true

2003-12-19 Thread Larry Wall
On Fri, Dec 19, 2003 at 12:24:29PM -0700, Luke Palmer wrote: : Abhijit A. Mahabal writes: : > On Fri, 19 Dec 2003, Larry Wall wrote: : > : > > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : > > : Of course, when I do: : > > : : > > : my $x = 0 but (true|false); : > > : : > >

Re: Object Order of Precedence (Was: Vocabulary)

2003-12-19 Thread Larry Wall
On Mon, Dec 15, 2003 at 07:02:53PM -0800, Jonathan Lang wrote: : Larry Wall wrote: : > Jonathan Lang wrote: : > : Let's see if I've got this straight: : > : : > : role methods supercede inherited methods; : > : > But can defer via SUPER:: : > : > : class methods supercede role methods; : > : >

Re: but true

2003-12-19 Thread Luke Palmer
Abhijit A. Mahabal writes: > On Fri, 19 Dec 2003, Larry Wall wrote: > > > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: > > : Of course, when I do: > > : > > : my $x = 0 but (true|false); > > : > > : then what happens? > > > > That's the problem with making them methods. Any

Re: but true

2003-12-19 Thread Abhijit A. Mahabal
On Fri, 19 Dec 2003, Larry Wall wrote: > On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: > : Of course, when I do: > : > : my $x = 0 but (true|false); > : > : then what happens? > > That's the problem with making them methods. Any such operational > definition is going to get y

Re: but true

2003-12-19 Thread Larry Wall
On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : Of course, when I do: : : my $x = 0 but (true|false); : : then what happens? That's the problem with making them methods. Any such operational definition is going to get you in trouble. I think I like them better as enums, be

Re: but true

2003-12-19 Thread Larry Wall
On Fri, Dec 19, 2003 at 10:36:01AM -0600, Adam D. Lopresto wrote: : I've been trying to follow the recent discussion on roles and properties and : traits and such, but there's something that bugs me. If I understand : correctly, adding a role at runtime using but won't override any methods : defin

Re: but true

2003-12-19 Thread Austin Hastings
--- Austin Hastings <[EMAIL PROTECTED]> wrote: > > --- "Adam D. Lopresto" <[EMAIL PROTECTED]> wrote: > > #Actually, how do we define this? > > method asBoolean(Complex $self:){ > > return $self.real || $self.imag; > > } > > > > > > ... > > > > > > then somewhere in a function > > > >

Re: but true

2003-12-19 Thread Austin Hastings
--- "Adam D. Lopresto" <[EMAIL PROTECTED]> wrote: > I've been trying to follow the recent discussion on roles and > properties and traits and such, but there's something that bugs me. I tried for weeks before I could download the "traits paper". I finally got it this week, and it has clarified s

but true

2003-12-19 Thread Adam D. Lopresto
I've been trying to follow the recent discussion on roles and properties and traits and such, but there's something that bugs me. If I understand correctly, adding a role at runtime using but won't override any methods defined by the class itself (but it will override inherited methods). But then