4 ms·
> Lua can have functions that assume a "this" parameter (Lua calls it "self") Even Lua's assumed "self" via the thing:funcname(...) call is just a charade and
by ebg13 6y ago
> Lua can have functions that assume a "this" parameter (Lua calls it "self")
Even Lua's assumed "self" via the thing:funcname(...) call is just a charade and is secretly just thing.funcname(thing, ...). The split between . and : calling, IME as an informal Lua teacher, is confusing to programming newbies when they first encounter it and I kinda wish the language hadn't chosen _that_ as the thing to spend time implementing.
- spc476 6y agoThe same is true in C++ and Java, only the "self" argument is completely hidden in that case.