Decorate-sort-undecorate idiom: Difference between revisions
m
→{{header|Raku}}: change explicit ST to use an arity two comparitor to disable automatic ST. same output
(More than 5 solutions, promoted to non-draft task) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: change explicit ST to use an arity two comparitor to disable automatic ST. same output) |
||
Line 308:
# explicit schwartzian transform
dd <Rosetta Code is a programming chrestomathy site>.map({$_=>.chars}).sort({$^one.value cmp $^the-other.value}).map({.key});</syntaxhighlight>
{{out}}
( <code>dd</code> is the built in "data-dumper" function; a verbose and explicit representation of an objects contents.)
Line 314:
("a", "is", "Code", "site", "Rosetta", "programming", "chrestomathy").Seq</pre>
More complicated transforms may ''require'' an explicit schwartzian transform routine. An example of where an explicit transform is desirable is the <code>schwartzian()</code> routine in the [[P-value_correction#Raku|Raku entry for the P-value_correction task]].
=={{header|Wren}}==
|