3 ms·
Arity explanation: https://en.wikipedia.org/wiki/Arity https://en.wikipedia.org/wiki/Arity From the blurb you quoted, it sounds like Lua doesn't check function
by bnert 3y ago
Arity explanation: https://en.wikipedia.org/wiki/Arity https://en.wikipedia.org/wiki/Arity
From the blurb you quoted, it sounds like Lua doesn't check function argument arity natively, and fennel can. This means that fennel applies a runtime check to validate if a function was called with an expected arity, and if not, propagates an error (however Lua does that, I do not know), hence why arity checked functions are not as performant.
- nmz 3y agoSo it basically does function M(...) if select("#",...)>3 then error("failed arity check on M()") end end
- ravi-delia 3y agopretty much, yeah