I didn't mean "it is impossible to build logic incorporating the number of parameters passed to a function", but rather "there will be no difference between calling an ordinary Lua function with (a, b, nil) vs (a, b), unlike table.insert, without extensive effort"
Sooner or later, a budding Lua programmer makes an index an optional, last parameter to a function, and then passes it through to `insert`.
If what you're inserting happens to be a number, this silently does the wrong thing. Suffice to say I won't ever forget this particular wart on what's become my favorite language.
Sooner or later, a budding Lua programmer makes an index an optional, last parameter to a function, and then passes it through to `insert`.
If what you're inserting happens to be a number, this silently does the wrong thing. Suffice to say I won't ever forget this particular wart on what's become my favorite language.