RosettaCodeData/Task/Function-composition/Quackery/function-composition.quackery

18 lines
490 B
Plaintext

[ nested swap
nested swap join ] is compose ( g f --> [ )
( ----- demonstration ----- )
( create a named nest -- equivalent to a function )
[ 2 * ] is double ( n --> n )
( "[ 4 + ]" is an unnamed nest
-- equivalent to a lambda function. )
( "quoting" a nest with ' puts it on the stack
rather than it being evaluated. "do" evaluates
the top of stack. )
19 ' double ' [ 4 + ] compose do echo