Decorate-sort-undecorate idiom: Difference between revisions
→{{header|Factor}}: Use stdlib
(Added Quackery.) |
(→{{header|Factor}}: Use stdlib) |
||
Line 213:
=={{header|Factor}}==
{{works with|Factor
<code>map-sort</code> employs the decorate-sort-undecorate idiom, while <code>sort-by</code> does not.
<syntaxhighlight lang="factor">
USING: prettyprint sequences sorting.extras ;
{ "Rosetta" "Code" "is" "a" "programming" "chrestomathy" "site" }
[ length ]
</syntaxhighlight>
{{out}}
|