I still have several points unclear, this is my sample:
###
class Base {
method toHash() {
return {};
}
}
role FooBar {
has $.foo is rw;
has $.bar is rw;
toHash.wrap({
my $hash = callsame();
$hashfoo = $self.foo;
Hi,
Xi Yang wrote:
1: Does Perl 6 has method modifiers like those in Moose?
Perl 6 has traits, so you can write for example
class A {
method x() is rw { ...}
}
to indicate that it's an lvalue routine (though I don't think it's
implemented in Rakudo yet).
Where can I get the doc about
Xi Yang wrote:
You might mis-understood method modifiers. I mean:
before x()
after x()
around x()
In Perl 6, you do that with wrapping:
http://perlcabal.org/syn/S06.html#Wrapping
Cheers,
Moritz
On Mon, Jun 21, 2010 at 09:47:37AM +0100, Smylers wrote:
Larry Wall writes:
On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote:
: On Fri, Jun 18, 2010 at 11:15, Smylers smyl...@stripey.com wrote:
:
: For the benefit of Perl 5 programmers used to string reverse it
: would
On Mon, Jun 21, 2010 at 10:47, Smylers smyl...@stripey.com wrote:
Larry Wall writes:
On Fri, Jun 18, 2010 at 11:21:52AM +0200, Jan Ingvoldstad wrote:
: On Fri, Jun 18, 2010 at 11:15, Smylers smyl...@stripey.com wrote:
:
: For the benefit of Perl 5 programmers used to string reverse
Warning on using any list-y op on a scalar seems like a good idea, and
the fact that the idea arose after a perl5 misunderstanding now looks
like a red herring. That is, while warning on only
reverse-on-a-scalar may be a bad idea and perl5 specific, I'd vote for
warning on all apparent mis-uses of