Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function chain(f, nf)
- local nf = nf or #f
- local function pass(i, ...)
- if i == nf then
- return f[nf](...)
- else
- return pass(i + 1, f[i](...))
- end
- end
- return function(...)
- return pass(1, ...)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement