now that Perl6 is suddenly all around us, can someone explain to me the new . syntax for subroutine calls? I was under the impression that this is the replacement for Perl5's ->, making it more compatible with conventions in many other languages (such as Java), and being somewhat reserved for use in object-oriented programming.
But looking at the Perl6/Pugs quicksort example it seems to be okay to use it for normal function calls as well (as opposed to the current -> whose usage outside of OO is frowned upon).
Is there a reason why that last line is not writtenuse v6; multi sub quicksort ( ) { () } multi sub quicksort ( *$x, *@xs ) { my @pre = @xs.grep:{ $_ < $x }; my @post = @xs.grep:{ $_ >= $x }; (@pre.quicksort, $x, @post.quicksort); } (1, 5, 2, 4, 3).quicksort.say;
Please enlighten your brother in his confusion (and I have not even started to ponder about the many new ways to specify argument *$x, $@xs).say quicksort (1, 5, 2, 4, 3);
PS: Multi subs are cool.
In reply to Perl6 dot syntax (for methods?) by Thilosophy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |