I want to see Role's added, even PHP got Traits before Perl. It doesn't have to be a huge thing, in fact all I want is the composition aspect. Let me do this:
I don't really want or need anything else right now, just that would be fine. We should have interfaces too, but they aren't really required just to support Role's. We should probably have some sugar like I did for class (e.g. role keyword. and some of the same modules/pragmas loaded for this too)
@harbud like all of my wishlist series, CPAN doesn't cut it. Fortunately this should be a feature of p5p MOP. @LeoNerd when I say that's all I want I should probably have clarified that It still has to do it via composition not inheritance, meaning application of multiple roles could/should behave differently than multiple inheritance. What I was trying to say is I'd be ok getting it without a MOP
"PHP got Traits before Perl"
ReplyDeleteCome on :) Is Moose released before PHP 5.4.0?
Just humour me a moment...
ReplyDeleteWhat about your example wouldn't work by:
package MyRole {
sub foo { return 'test' }
}
package MyClass {
use base qw( MyRole );
...
}
MyClass->new->foo;
?
@harbud like all of my wishlist series, CPAN doesn't cut it. Fortunately this should be a feature of p5p MOP. @LeoNerd when I say that's all I want I should probably have clarified that It still has to do it via composition not inheritance, meaning application of multiple roles could/should behave differently than multiple inheritance. What I was trying to say is I'd be ok getting it without a MOP
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteWell, if a MOP would be nice to have anyway, maybe you'd be interested in the #p5-mop hackathon in Norway in August. :)
ReplyDeletehttp://act.yapc.eu/mtmh2012/
I'd love to go, in fact I'd love to go and stay, unfortunately I don't see it as being financially feasible at this time.
ReplyDelete