Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform

by gaal (Parson)
on Nov 07, 2005 at 05:44 UTC ( #506235=note: print w/replies, xml ) Need Help??


in reply to Re: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
in thread Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform

I believe it is called "decorate-sort-undecorate" in the Python world (where it is being considered for entry into the core sort builtin).
  • Comment on Re^2: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform

Replies are listed 'Best First'.
Re^3: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
by eyepopslikeamosquito (Bishop) on Nov 07, 2005 at 11:45 UTC
Re^3: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
by MonkOfAnotherSect (Sexton) on Nov 07, 2005 at 06:00 UTC
    DSU (for short) is in list.sort() and the sorted() builtin as of 2.4 - eg: "mylist.sort(key=len)" will sort by length.
Re^3: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
by Aristotle (Chancellor) on Nov 07, 2005 at 14:27 UTC

    Last I checked, Perl6 was also supposed to support decoupling the key comparison from the extraction of keys from list elements. In Perl5, key extraction is conflated with comparison in a single sub, which means the key extraction code for $a is often copypasted for $b. Given that key extraction is decoupled from comparison, you’d also often need simple forms of comparison only, so there were ideas being bandied about for a more declarative comparison syntax for those forms.

    Now the motivation for all this was to reduce duplication and make the trivial cases simpler, but such syntax would neatly allow the runtime to do ST sorting internally, without the programmer having to do anything explicit about it.

    I don’t know what came of it, but I’d be surprised if it hasn’t made it into the current form of Perl6 in some shape. I should go look into this.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://506235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-06-05 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?