RosettaCodeData/Task/Higher-order-functions/Lambdatalk/higher-order-functions.lambdatalk
2023-07-01 13:44:08 -04:00

12 lines
247 B
Text

{def add
{lambda {:f :g :x}
{+ {:f :x} {:g :x}}}}
{add sin cos 10}
-> -1.383092639965822 // {+ {sin 10} {cos 10}}
{S.map sqrt {S.serie 1 5}}
-> 1 1.4142135623730951 1.7320508075688772 2 2.23606797749979
{S.reduce + {S.serie 1 10}}
-> 55