lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


There's the Y combinator trick:

print(( function(f)
           return function(i)
               return f(f, i)
           end
       end)(function(fac, n)
               if n > 1 then
                   return n * fac(fac, n-1)
               else
                   return 1
               end
            end)(10))