Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: (OT) The Schwartzian Transform in Java

by Ovid (Cardinal)
on Jun 10, 2003 at 23:00 UTC ( [id://264892]=note: print w/replies, xml ) Need Help??


in reply to (OT) The Schwartzian Transform in Java

And just to make it clear that dynamically typed languages have it all over statically typed languages, here's an ST in python to guarantee a stable sort:

def stable_sort(some_list, indices=xrange(sys.maxint)): decorated = zip(list,indices) decorated.sort return [item for item, index in decorated]

In fact, in the Python Cookbook, this is even referred to as a Schwartzian Transform.

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-29 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found