Currying: Difference between revisions

(Added Quackery.)
(→‎{{header|Quackery}}: second example)
Line 1,669:
 
The word <code>curried</code> in the definition below curries the word following it, (which should act on two arguments on the stack), with the argument on the top of the stack. In the shell dialogue in the '''output:''' section the word <code>+</code> is combined with the number <code>5</code> on the top of stack to create the curried lambda nest <code>[ ' 5 + ]</code> which will add 5 the number on the top of stack when it is evaluated with <code>do</code>.
 
In the second example we drop the 8 from the previous example from the stack and then use currying to join "lamb" to "balti".
 
<lang Quackery> [ ' [ ' ] swap nested join
Line 1,683 ⟶ 1,685:
...
 
Stack: 8</pre>
 
/O> drop
... $ " balti" curried join
... $ "lamb" swap do echo$
...
lamb balti
Stack empty.
</pre>
 
=={{header|Racket}}==
1,462

edits