But is that how most Julia programmers will write it?
I just asked someone in my office and they sent me this:
function fact(n::Integer)
n < 0 && return zero(n)
f = one(n)
for i in 2:n
f *= i
end
return f
end
They seem to have google'd the result, but I'm not judging that: That might be how Julia programmers code...