modern-compiler-ml/tiger/testcases/test4.tig

14 lines
160 B
Text
Raw Normal View History

/* define a recursive function */
let
/* calculate n! */
function nfactor(n: int): int =
if n = 0
then 1
else n * nfactor(n-1)
in
nfactor(10)
end