Hacker News new | past | comments | ask | show | jobs | submit login

In Lua:

  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))



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: