Open idbrii opened 2 years ago
fun.bind incorrectly adds arguments after unpacking. This line in particular:
fn(tbl.unpack(args), ...)
The call to unpack will only get the first argument since there are additional arguments after it.
Failing example:
local pr = fun.bind(print, "hello", "world") pr("!")
Actual Output:
hello !
Expected:
hello world !
Maybe instead it should be implemented like lume.fn. lume's a great util library and also uses the MIT license.
By the way, isn't bind redundant with functional.apply? Apply seems to be correct (and simpler). bind looks like an old forgotten utility that is no longer used?
fun.bind incorrectly adds arguments after unpacking. This line in particular:
The call to unpack will only get the first argument since there are additional arguments after it.
Failing example:
Actual Output:
Expected:
Maybe instead it should be implemented like lume.fn. lume's a great util library and also uses the MIT license.