[Vienna-pm] Perl 5 vs. Perl 6

Leopold Toetsch lt at toetsch.at
Sat Mar 5 00:34:45 PST 2005


Peter J. Holzer wrote:

>  Perl 6 looks like a Louis-XVI castle and garden to me. Straight,
>  symmetric, and bright. There are wigs to be powdered, minuets to be
>  danced, all quite boring.
> 
>     -- Abigail, zitiert von Autrijus Tang in
>        http://www.perl.com/pub/a/2005/03/03/pugs_interview.html
>        (Der Rest des Interviews ist übrigens auch lesenswert)

Yep - interessantes Interview. Apropos "quite boring":

$ cat quicksort.p6
#!perl6
use 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;

$ ./pugs quicksort.p6
12345

leo



More information about the Vienna-pm mailing list