# Factorial of a number def fact(n acc) if =(n 1) acc else # tagging a tail call with "@" so it can be optimized @fact(-(n 1) *(acc n)) end end def main() display("Running fact(50)...") display(fact(50. 1)) end