in reply to Re: Perl6 sorting
in thread Perl6 sorting

It would be easy to write something that translated a verbose sort spec into a concise one. A "key" macro would be able to process Uri's syntax directly, for instance. But it would probably only be useful in 1% of the time--nearly all sorts are trivial. And we're adding enough new "key" words to Perl 6 as it is...

Replies are listed 'Best First'.
Re: Re: Re: Perl6 sorting
by matija (Priest) on Mar 06, 2004 at 12:24 UTC
    Yes, but what would be interesting is making an approximation of this as a Perl 5 module.

    The sorting part isn't hard, IMHO: you could translate the thing into a sort-of-Schwartizan transform where an array element would be either a key, or a coderef, and sort that fairly nicely.

    Finding a good way of passing all that data to a Perl5 routine, however, would be a challenge.

    Which, I think, is why Damian chose the theme. I don't think his point was the wonderfull multitude of things his sort is going to do, it's all the wonderfull ways of communicating with subroutines that the new syntax will make possible.