lama_byterun/stdlib/regression/test08.expr

7 lines
176 B
Text
Raw Normal View History

import Fun;
local fact = fix (fun (self) {fun (n) {if n <= 1 then 1 else n * self (n-1) fi}});
printf ("%d\n", fact (3));
printf ("%d\n", fact (5));
printf ("%d\n", fact (7))