Hacker News new | past | comments | ask | show | jobs | submit login

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.




Makes sense. I was just clarifying "It's not possible to build this in pure Lua": it is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: