RosettaCodeData/Task/First-class-functions/Quackery/first-class-functions-2.quackery
2023-10-02 18:11:16 -07:00

24 lines
615 B
Text

[ dup dup f* f* ] is cubed ( $ --> $ )
[ f 1 f 3 f/ f** ] is cuberoot ( $ --> $ )
[ table sin cos cubed ] is A ( n --> [ )
[ table asin acos cuberoot ] is B ( n --> [ )
[ dip nested nested join ] is compose ( x x --> [ )
[ dup dip A B compose do ] is ->A->B-> ( f n --> f )
' [ f 0.5 f 1.234567 ]
witheach
[ do 3 times
[ dup echo$
say " -> "
i^ A echo
say " -> "
i^ B echo
say " -> "
dup i^ ->A->B-> echo$
cr ]
drop cr ]