@[email protected] to Programmer [email protected]English • 12 days agoThe meaning of thislemmy.worldimagemessage-square71fedilinkarrow-up1475cross-posted to: [email protected]
arrow-up1475imageThe meaning of thislemmy.world@[email protected] to Programmer [email protected]English • 12 days agomessage-square71fedilinkcross-posted to: [email protected]
minus-squareDie Martin Dielinkfedilink6•edit-210 days agoKinda. Lua defines it implicitly only when you use the function foo:bar(a, b, c) -- note the colon syntactic sugar, which gets translated to function foo.bar(self, a, b, c) -- note the period In all cases, self is a regular variable name. You can even redeclare a new local with that name even when the old one is in scope. Edit: some typos
minus-square@[email protected]linkfedilink3•11 days agoI don’t see how what you said is inconsistent with me saying “self” is special in lua. Note that I did not say it’s a keyword.
Kinda.
Lua defines it implicitly only when you use the
syntactic sugar, which gets translated to
In all cases,
self
is a regular variable name. You can even redeclare a new local with that name even when the old one is in scope.Edit: some typos
I don’t see how what you said is inconsistent with me saying “self” is special in lua. Note that I did not say it’s a keyword.
Derp, I misread.