[ create a new paste ] login | about

Link: http://codepad.org/SNWO1Y6K    [ raw code | output | fork ]

Lua, pasted on Jun 8:
1
2
3
4
5
function apply(tbl, func)
  for key, val in ipairs(tbl) do func(val) end
end

apply({1,2,3}, function (x) print(x + 1) end)


Output:
1
2
3
2
3
4


Create a new paste based on this one


Comments: