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

6 lines
160 B
Text

callee(n) := (print(sconcat("called with ", n)), n + 1)$
caller(f, n) := sum(f(i), i, 1, n)$
caller(callee, 3);
"called with 1"
"called with 2"
"called with 3"