Re: Two questions on Perl 6 functionality

2010-06-21 Thread Xi Yang
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;

Re: Two questions on Perl 6 functionality

2010-06-21 Thread Moritz Lenz
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

Re: Two questions on Perl 6 functionality

2010-06-21 Thread Moritz Lenz
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

Re: Something wrong with str.reverse

2010-06-21 Thread Patrick R. Michaud
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

Re: Something wrong with str.reverse

2010-06-21 Thread Jan Ingvoldstad
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

Re: Something wrong with str.reverse

2010-06-21 Thread yary
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