Re: The Sort Problem (was: well, The Sort Problem)

2004-02-13 Thread Angel Faus
Friday 13 February 2004 15:02, Dan Sugalski wrote: > > If you're *really* looking to get fancy, why not just allow the > sort specification to be done with SQL? Comfortable, > well-understood, already has a decade or so of stupid things welded > into it [...] > > Heck, you could even unify map, gr

Re: The Sort Problem (was: well, The Sort Problem)

2004-02-13 Thread Dan Sugalski
At 11:52 PM -0700 2/12/04, Luke Palmer wrote: But it needs some major syntax work so it can feel more like it's a part of the language instead of a library function. Not, mind, that I think Perl's syntax needs to be changed at all to accommodate. Since everyone's well past mad here and deep into d

Re: The Sort Problem (was: well, The Sort Problem)

2004-02-13 Thread Rod Adams
Here's my stab at a sort syntax, pulling syntax over from REs: @out <== sort key:ri($_->[2]), key:s($_->[4]) <== @in; Basicly, you have a list of RE syntax like C values, whilch take various modifiers to say how to play with that key, and then an expr on how to generate the key given element $

Re: The Sort Problem (was: well, The Sort Problem)

2004-02-12 Thread Luke Palmer
Jonathan Lang writes: > > We already have that. It's spelled: > > > > routine [EMAIL PROTECTED]; > > > > Or > > > > routine * <== @x; > > Then you've got your solution: > > @sorted = sort {infix:<=> * map {$_.foo('bar').compute}, $^a, $^b } > @unsorted; > > or > > @