On Fri, Apr 23, 2004 at 03:34:32PM -0700, Jonathan Lang wrote:
: Larry Wall wrote:
: > On Fri, Apr 23, 2004 at 02:37:58PM -0700, Jonathan Lang wrote:
: > : Note that the problem extends past accessors: a role's methods can
: > : access its attributes directly. So:
: > :
: > : role A {has Cat $.
Larry Wall wrote:
> On Fri, Apr 23, 2004 at 02:37:58PM -0700, Jonathan Lang wrote:
> : Note that the problem extends past accessors: a role's methods can
> : access its attributes directly. So:
> :
> : role A {has Cat $.x; method m1 {return $.x;};}
> : role B {has Dog $.x; method m2 {return $
On Fri, Apr 23, 2004 at 02:37:58PM -0700, Jonathan Lang wrote:
: Note that the problem extends past accessors: a role's methods can access
: its attributes directly. So:
:
: role A {has Cat $.x; method m1 {return $.x;};}
: role B {has Dog $.x; method m2 {return $.x;};}
: class Foo {does Cat
At 2:37 PM -0700 4/23/04, Jonathan Lang wrote:
Austin Hastings wrote:
Jonathan Lang wrote:
> role A {has Cat $.x;}
> role B {has Dog $.x;}
> class Foo {does Cat; does Dog;}
> my Foo $bar;
> $bar.x; # Is this a Cat or a Dog?
If, however, two roles try to introduce a method of the same nam
Austin Hastings wrote:
> Jonathan Lang wrote:
> > role A {has Cat $.x;}
> > role B {has Dog $.x;}
> > class Foo {does Cat; does Dog;}
> > my Foo $bar;
> > $bar.x; # Is this a Cat or a Dog?
>
>
> If, however, two roles try to introduce a method of the same name (for
> some definition of name), t
On Fri, 2004-04-23 at 14:28, Aaron Sherman wrote:
> I would expect wildcard delegation not to care about method conflicts at
> all, since what's being done is, by its nature, much more dynamic
> anyway.
I misunderstood roles when I said this... I now get why this is a
problem, sorry.
--
Aaron S
> -Original Message-
> From: Larry Wall [mailto:[EMAIL PROTECTED]
>
> On Fri, Apr 23, 2004 at 01:05:21PM -0400, Austin Hastings wrote:
> : That seems like a good disambiguation marker, too:
> :
> : class Trog does Tree does Dog {...}
> :
> : # error: conflicting 'bark' methods
> :
> :
On Fri, 2004-04-23 at 14:17, Larry Wall wrote:
> : does Tree
> : handles «bark»
> : does Dog
> That works in the case of an explicitly named method, since that
> effectively makes .bark a method in the current class. It would not
> work for a wildcard delegation though, unles
On Fri, Apr 23, 2004 at 01:05:21PM -0400, Austin Hastings wrote:
: That seems like a good disambiguation marker, too:
:
: class Trog does Tree does Dog {...}
:
: # error: conflicting 'bark' methods
:
: class Trog
: is PersistentObject
: handles «meta dispatch SERIALIZE»
:
> -Original Message-
> From: Aaron Sherman [mailto:[EMAIL PROTECTED]
>
> On Fri, 2004-04-23 at 11:44, Brent 'Dax' Royal-Gordon wrote:
> > Aaron Sherman wrote:
>
> > > class c { does a for <>; does b for <>; }
>
> > Funny how similar that is to
> >
> > class c { does a handles <>; d
On Fri, 2004-04-23 at 11:44, Brent 'Dax' Royal-Gordon wrote:
> Aaron Sherman wrote:
> > class c { does a for <>; does b for <>; }
> Funny how similar that is to
>
> class c { does a handles <>; does b handles <>; }
In "Relationship to Roles" A12 makes the point that delegation and rol
Aaron Sherman wrote:
seen the "does b". You could assert the other way around:
class c { does a for <>; does b for <>; }
which is kind of nifty looking, but some may blanch at the dual meaning
for "for"
Funny how similar that is to
class c { does a handles <>; does b handles <>; }
--
B
On Wed, 2004-04-21 at 12:17, chromatic wrote:
> * Add a disambiguatey method to PoliceDog that dispatches
> appropriately. (Insert handwavey "well you *could* do it this way or
> you *might* do it that way.")
I agree, but given that the average user should probably not have to
interact with the
On Wed, 2004-04-21 at 04:19, Buddha Buck wrote:
> From one C6PAN module:
>
> role Dog {
>has $.collar;
>...
> }
> From a third C6PAN module:
>
> class PoliceDog does Dog does LawEnforcementOfficer { ... }
> role LawEnforcementOfficer {
>method arrest { ... }
>has $.collar;
Originally sent to Austin alone by accident
Austin Hastings wrote:
-Original Message-
From: Jonathan Lang [mailto:[EMAIL PROTECTED]
role A {has Cat $.x;}
role B {has Dog $.x;}
class Foo {does Cat; does Dog;}
my Foo $bar;
$bar.x; # Is this a Cat or a Dog?
If, however, two roles try
> -Original Message-
> From: Jonathan Lang [mailto:[EMAIL PROTECTED]
>
> role A {has Cat $.x;}
> role B {has Dog $.x;}
> class Foo {does Cat; does Dog;}
> my Foo $bar;
> $bar.x; # Is this a Cat or a Dog?
If, however, two roles try to introduce a method of the same name (for some
defini
role A {has Cat $.x;}
role B {has Dog $.x;}
class Foo {does Cat; does Dog;}
my Foo $bar;
$bar.x; # Is this a Cat or a Dog?
=
Jonathan "Dataweaver" Lang
__
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http:/
17 matches
Mail list logo