f_outer(n){
f_inner(n, accumulator){
if 1 == n
accumulator
else
f_inner(n - 1, n * accumulator)
}
return f_inner(n, 0)
}

修正。
内部関数を、return するのが抜けていた