db4
Slava Pestov 2008-12-04 00:28:16 -06:00
parent 247c9542bd
commit 1247ebbac9
1 changed files with 1 additions and 3 deletions

View File

@ -758,12 +758,10 @@ $nl
"Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:" "Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:"
{ $code { $code
"! First alternative; uses dip" "! First alternative; uses dip"
"[ [ 1 + ] dip 1 - dip ] 2 *" "[ [ 1 + ] dip 1 - ] dip 2 *"
"! Second alternative: uses tri*" "! Second alternative: uses tri*"
"[ 1 + ] [ 1 - ] [ 2 * ] tri*" "[ 1 + ] [ 1 - ] [ 2 * ] tri*"
} }
$nl
"A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "." "A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "."
{ $subsection "spread-shuffle-equivalence" } ; { $subsection "spread-shuffle-equivalence" } ;