Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Ovid
- Original Message From: Timothy S. Nelson wayl...@wayland.id.au 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

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Timothy S. Nelson
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

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Jonathan Worthington
Ovid wrote: - Original Message From: Timothy S. Nelson wayl...@wayland.id.au 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

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Jon Lang
Jonathan Worthingtonjonat...@jnthn.net 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

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Jonathan Worthington
Jon Lang wrote: Jonathan Worthingtonjonat...@jnthn.net 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

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Jonathan Worthington
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

Reusing code: Everything but the kitchen sink

2009-07-08 Thread Jon Lang
Jonathan Worthington wrote in YAPC::EU and Perl 6 Roles: More fitting to me would be an adverb to the does trait modifier... class C does R1 :withoutfoo bar does R2 :withoutbaz { ... } The thing is that in this case, does the class actually do R1 and R2? If you are going to derive an

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Kyle Hasselbacher
On Tue, Jul 7, 2009 at 7:13 AM, Jonathan Worthingtonjonat...@jnthn.net 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:

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Ovid
- Original Message From: Jonathan Worthington jonat...@jnthn.net 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

Private methods in Roles (Was: Re: YAPC::EU and Perl 6 Roles)

2009-07-08 Thread Daniel Ruoso
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 of

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Dave Whipp
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

r27485 - docs/Perl6/Spec/S32-setting-library

2009-07-08 Thread pugs-commits
Author: moritz Date: 2009-07-08 23:41:43 +0200 (Wed, 08 Jul 2009) New Revision: 27485 Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod Log: [S32/Num] log's base is positional Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Larry Wall
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 overrides tells Perl 6

Roles discussion

2009-07-08 Thread Jonathan Worthington
Hi all, It's been interesting to participate in the roles discussion so far, and I'm happy to see there's a lot of interest in getting the right options and the right defaults. I'm leaving tomorrow morning on vacation, and will be mostly offline for a week or so (the alps are quite a

r27487 - docs/Perl6/Spec

2009-07-08 Thread pugs-commits
Author: lwall Date: 2009-07-09 02:36:00 +0200 (Thu, 09 Jul 2009) New Revision: 27487 Modified: docs/Perl6/Spec/S14-roles-and-parametric-types.pod Log: [S14] a slightly closer approximation to eventual reality Modified: docs/Perl6/Spec/S14-roles-and-parametric-types.pod