Decorate-sort-undecorate idiom: Difference between revisions

J draft
(J draft)
Line 406:
"programming"
"chrestomathy"</pre>
 
=={{header|J}}==
 
J's native sort primitive always sorts on a key (which might be the list itself), such that each element of the key is calculated only once. This corresponds to APL's grade up primitive (though comparing dates on this approach vs. lisp's approach seems problematic due to deficiencies in historical evidence).
 
Thus, for example:
 
<syntaxhighlight lang=J> >(/: #@>) ;:'Rosetta Code is a programming chrestomathy site'
a
is
Code
site
Rosetta
programming
chrestomathy
</syntaxhighlight>
 
=={{header|JavaScript}}==
6,962

edits