TSa wrote:
> HaloO,
>
> Jon Lang wrote:
>>
>> Well, yes and no. The class still has the final say on how a given
>> method is to be implemented; the only thing being debated here is
>> whether or not the class should have to explicitly pull rank to
>> redefine a method being provided by a role, or
HaloO,
Jon Lang wrote:
Well, yes and no. The class still has the final say on how a given
method is to be implemented; the only thing being debated here is
whether or not the class should have to explicitly pull rank to
redefine a method being provided by a role, or if it does so silently.
The
HaloO,
Jon Lang wrote:
I'd still like to get a synonym for "mandate role", though - a word
that captures the meaning of "unit of behavior".
A bit burdened with conflicting meaning but I think "mixin" is what
you are looking for.
Regards, TSa.
--
"The unavoidable price of reliability is simpl
Raphael Descamps wrote:
> Am Freitag, den 10.07.2009, 17:06 -0700 schrieb Jon Lang:
>> How about this: in role composition, "mandate" causes methods to take
>> precedence over other methods with which they would normally conflict,
>> and to conflict with methods that would normally take precedence
Am Freitag, den 10.07.2009, 17:06 -0700 schrieb Jon Lang:
> How about this: in role composition, "mandate" causes methods to take
> precedence over other methods with which they would normally conflict,
> and to conflict with methods that would normally take precedence over
> them.
I really dislik
Jon Lang wrote:
> "supersede" already has a meaning with respect to classes; and what
> I'm thinking of would apply to classes as well as roles; so I'm going
> to suggest another keyword.
>
> How about this: in role composition, "mandate" causes methods to take
> precedence over other methods with
Larry Wall wrote:
> Dave Whipp wrote:
>> Ovid wrote:
>>
>>> I'd like to see something like this (or whatever the equivalent Perl 6
>>> syntax would be):
>>>
>>> class PracticalJoke does Bomb does SomeThingElse {
>>> method fuse() but overrides { ... }
>>> }
>>>
>>> The "overrides" tells Pe
On 2009-Jul-8, at 1:49 pm, Ovid wrote:
That being said, roles also have two competing uses (though they
don't conflict as badly). As units of behavior, they provide the
functionality your code needs. However, they can also serve as an
interface.
Maybe there are Interfaces, which are, we
On Wed, Jul 08, 2009 at 01:59:53PM -0700, Dave Whipp wrote:
> Ovid wrote:
>
>> I'd like to see something like this (or whatever the equivalent Perl 6
>> syntax would be):
>>
>> class PracticalJoke does Bomb does SomeThingElse {
>> method fuse() but overrides { ... }
>> }
>>
>> The "overrid
Ovid wrote:
I'd like to see something like this (or whatever the equivalent Perl 6 syntax
would be):
class PracticalJoke does Bomb does SomeThingElse {
method fuse() but overrides { ... }
}
The "overrides" tells Perl 6 that we're overriding the fuse() method
> from either Bomb or Som
Em Qua, 2009-07-08 às 12:49 -0700, Ovid escreveu:
> Behavioral: if you are primarily relying on roles to provide behavior
> (as we do at the BBC), then silently discarding the role's behavior by
> providing a method of the same name in your class can lead to very
> confusing bugs. I've lost a lot
- Original Message
> From: Jonathan Worthington
> Ovid wrote:
> > It needs the timed fuse() from a Bomb role and a non-lethal explode() from
> > a
> Spouse role, though each role provides both methods.
> I'm curious...
>
> 1) How often do you in real life find yourself needing to do
On Tue, Jul 7, 2009 at 7:13 AM, Jonathan Worthington wrote:
> (Note to the bored: feel free to beat me to adding something like these last
> two to the spectests...I'm away for the afternoon/evening.)
In r27483, I added these tests to S12-methods/multi.t:
http://dev.pugscode.org/changeset/27483
Hi,
Going back to the original question...
Ovid wrote:
It needs the timed fuse() from a Bomb role and a non-lethal explode() from a
Spouse role, though each role provides both methods.
I'm curious...
1) How often do you in real life find yourself needing to do things like
this in real life?
Jon Lang wrote:
Jonathan Worthington wrote:
Ovid wrote:
Though I have issues with Jonathan's approach (I don't like classes
silently discarding role methods as this has caused us many bugs at the
BBC), it's much cleaner that what I see here.
s/Jonathan's approach/Perl 6's approa
Jonathan Worthington wrote:
> Ovid wrote:
>> Though I have issues with Jonathan's approach (I don't like classes
>> silently discarding role methods as this has caused us many bugs at the
>> BBC), it's much cleaner that what I see here.
>
> s/Jonathan's approach/Perl 6's approach/ # at least, so fa
Ovid wrote:
- Original Message
From: Timothy S. Nelson
class PracticalJoke {
has Bomb $bomb handles ;
has Spouse $spouse handles ;
}
Note that I have no idea where (if anywhere) the type goes in this.
Hopefully someone will correct me here. Note that this does not us
On Wed, 8 Jul 2009, Ovid wrote:
Note that I have no idea where (if anywhere) the type goes in this.
Hopefully someone will correct me here. Note that this does not use the roles
as roles; it uses them punned as classes. But it does what you asked :).
Though I have issues with Jonathan'
- Original Message
> From: Timothy S. Nelson
>
> class PracticalJoke {
> has Bomb $bomb handles ;
> has Spouse $spouse handles ;
> }
>
> Note that I have no idea where (if anywhere) the type goes in this.
> Hopefully someone will correct me here. Note that this does not us
On Tue, 7 Jul 2009, Ovid wrote:
role Bomb {
method fuse (){ say '3 .. 2 .. 1 ..' }
method explode () { say 'Rock falls. Everybody dies!' }
}
role Spouse {
method fuse (){ sleep rand(20); say "Now!" }
method explode () { say 'You worthless piece of junk! Why I should ...'
Brandon S. Allbery KF8NH wrote:
On Jul 7, 2009, at 08:13 , Jonathan Worthington wrote:
Brandon S. Allbery KF8NH wrote:
I was trying to figure out how to do it with nextsame, but that's
not looking very simple.
On the other hand, if they were multis then they get added to the
multi candidate
On Jul 7, 2009, at 08:13 , Jonathan Worthington wrote:
Brandon S. Allbery KF8NH wrote:
I was trying to figure out how to do it with nextsame, but that's
not looking very simple.
On the other hand, if they were multis then they get added to the
multi candidate list and therefore you can next
Brandon S. Allbery KF8NH wrote:
On Jul 7, 2009, at 07:34 , Jonathan Worthington wrote:
Jon Lang wrote:
I believe that the official word is to say:
class PracticalJoke does Bomb does Spouse {
method fuse () { Bomb::fuse }
method explode () { Spouse::explode }
}
This way won't work, be
On Jul 7, 2009, at 07:34 , Jonathan Worthington wrote:
Jon Lang wrote:
I believe that the official word is to say:
class PracticalJoke does Bomb does Spouse {
method fuse () { Bomb::fuse }
method explode () { Spouse::explode }
}
This way won't work, because:
* It's doing a sub call t
Jon Lang wrote:
I believe that the official word is to say:
class PracticalJoke does Bomb does Spouse {
method fuse () { Bomb::fuse }
method explode () { Spouse::explode }
}
This way won't work, because:
* It's doing a sub call to something that's a method
* The lookup won't wor
Ovid wrote:
Giving a talk about roles at YAPC::EU in Lisbon
Hey, me too! :-)
and I'm a bit stuck on how to translate a Perl 5 example into Perl 6. Basically, Imagine
a "PracticalJoke" class which has fuse() and explode methods(). It needs the
timed fuse() from a Bomb role and a non-lethal
On Tue, Jul 7, 2009 at 2:48 AM,
Ovid wrote:
>
> Giving a talk about roles at YAPC::EU in Lisbon and I'm a bit stuck on how to
> translate a Perl 5 example into Perl 6. Basically, Imagine a "PracticalJoke"
> class which has fuse() and explode methods(). It needs the timed fuse() from
> a Bomb r
Giving a talk about roles at YAPC::EU in Lisbon and I'm a bit stuck on how to
translate a Perl 5 example into Perl 6. Basically, Imagine a "PracticalJoke"
class which has fuse() and explode methods(). It needs the timed fuse() from a
Bomb role and a non-lethal explode() from a Spouse role, th
28 matches
Mail list logo