in reply to Re: Pugs now works - but how?
in thread Hello Perl 6. Running pugs on Windows

Perhaps also helpful is the close equivalent in Perl5. No magical multi-methods, and a bit more verbose... but not too shabby. Come to think of it this should work fine in Perl6 as well, eh?

sub quicksort { return unless @_; my ($x, @xs) = @_; my @pre = grep{ $_ < $x } @xs; my @post = grep{ $_ >= $x } @xs; (quicksort(@pre), $x, quicksort(@post)); } my @a = quicksort(1, 5, 2, 4, 3); print "@a\n";

Replies are listed 'Best First'.
If only I could vote twice...
by rg0now (Chaplain) on Feb 19, 2005 at 23:41 UTC
    or more on a node, then I would immediately upvote both parents multiple times! These two were just the kind of enlightning nodes for which I like and regularly visit Perl Monks. This opened up a completely new way of thinking of programming for me...

    Starting along the reply of awwaiid and pernod I have just finished the refactoring of one of my previous modules. The code is now much more concise, short and, perhaps most importantly, efficient as before. Thank you very much...

    rg0now