Skip to content

Instantly share code, notes, and snippets.

@exelotl
Created August 27, 2015 19:32
Show Gist options
  • Save exelotl/f50ed6c6e8d1c77324d8 to your computer and use it in GitHub Desktop.
Save exelotl/f50ed6c6e8d1c77324d8 to your computer and use it in GitHub Desktop.
is there a proper name for this?
function pootis(f, ...)
local t = {}
for i,v in ipairs({...}) do
t[i] = f(v)
end
return unpack(t)
end
-- example usage
-- > pootis(math.floor, 1.1, 2.2, 3.3, 4.4)
-- 1 2 3 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment