Jump to content

Decorate-sort-undecorate idiom: Difference between revisions

m
(Added Algol 68)
Line 49:
 
=={{header|ALGOL 68}}==
Algol 68 doesn't have standard mapping operators, but it is easy enough to construct some, as shown here.<br>
Note, Algol 68 doesn't have procedure overloading but does have operator overloading.<br>
If decorating other than STRINGs with INTs was required, different MODEs and OPs would be needed. As the MODE of the decorated result would be implied by the MODE yielded by the decorating procedure, the same names could be used for the DECORATE, UNDECORATE and SORT operators, only the name of the decorated MODE would be different.
<syntaxhighlight lang="algol68">
BEGIN # Schwartzian transform - decorate a list of strings, sort them and #
3,060

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.