defmodule M do def factorial_(n) do result = 1 for i <- 1..n do result = result * i end result end end IO.inspect(M.factorial_(5))
输出应该是 120,但我一直得到 1。假设 for 循环根本不运行?