function Y(f) local function g(...) return f(g,...) end return g end print(Y(function(rec,x) if x < 2 then return 1 else return x * rec(x-1) end end)(5))