Decorate-sort-undecorate idiom: Difference between revisions

Content added Content deleted
(Added QBasic)
m (fixing typos)
Line 31: Line 31:
;The Schwartzian transform
;The Schwartzian transform


Randal L. Schwartz wrote an implementation of the decorate-order-undecorate idiom in Perl in 1994, which gained much popularity in the Perl community. It was named [[wp:Schwartzian transform|"Schwartzian transform"]]. Today the terms decorate-order-undecorate and the Schwartzian transform are used interchangeably, even outside the Perl community.
Randal L. Schwartz wrote an implementation of the decorate-sort-undecorate idiom in Perl in 1994, which gained much popularity in the Perl community. It was named [[wp:Schwartzian transform|"Schwartzian transform"]]. Today the terms decorate-sort-undecorate and the Schwartzian transform are used interchangeably, even outside the Perl community.


The [[wp:Schwartzian transform|Wikipedia page]] states that a solution can be called a "Schwartzian transform" only if it does not use named temporary lists or arrays. The Lisp solution and even the solution shown by Schwartz actually use intermediate lists, but these lists do not have explicit names, instead they use a functional composition of map-sort-map operations.
The [[wp:Schwartzian transform|Wikipedia page]] states that a solution can be called a "Schwartzian transform" only if it does not use named temporary lists or arrays. The Lisp solution and even the solution shown by Schwartz actually use intermediate lists, but these lists do not have explicit names, instead they use a functional composition of map-sort-map operations.