Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
With my work on "99 Problems", I find that "is copy" is getting annoying to type over and over again. Many of the problems are much simpler with "is copy", so the question is, "when is 'is copy' not necessary"? In fact, I'd like a shortcut for it, but Larry says (on #perl6) that slurpy *@some_array might default to "is copy" in the future. That would be at least a small win for stuff like this:
# P19 (**) Rotate a list N places to the left.
# Examples:
# * (rotate '(a b c d e f g h) 3)
# (D E F G H A B C)
# * (rotate '(a b c d e f g h) -2)
# (G H A B C D E F)
sub rotate (int $times is copy, *@list is copy) returns Array {
if $times < 0 {
$times += @list.elems;
}
@list.push: @list.shift for 1.. $times;
return @list;
}
rotate(3, <a b c d e f g h>).perl.say;
rotate(-2, <a b c d e f g h>).perl.say;
Why? (Score:1)
@foo.rotate($x).perl.sayIs there, within every Perl programmer, a Ruby/Smalltalk lover waiting to get out?Re: (Score:1)
Why is it backwards?
Re: (Score:1)
Re: (Score:1)
In Perl 5, people almost always do either this:
or this:
In both cases, you work on a copy. Almost never do people work directly with the values in
@_. And that works out very well, because you almost never want to pass parameters by reference, almost always by value.But the Perl 6 setup defaults to giving you named aliases (as opposed to the array of aliases you get with Perl
Re: (Score:1)
I actually meant "Why do you say that chained method calls are backwards?" I try to stay out of the perpetual pass by value/pass by reference wars. (I need some sort of self-discipline somewhere.)
Re: (Score:2)
While I knew what you were referring to, I do agree with Aristotle. In trying to work out the "99 Problems", I'm finding "is copy" is getting very annoying. I would be nice to have a simple syntax which would allow this, when it's appropriate.
Now if only I knew someone on the Perl 6 design team to explain that too ... :)