lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> >   :method instead self:method
> >and
> >   .field instead self.field

When you define methods, use the full syntax and choose a one-letter
variable instead of self:

	function MyClass.myMethod(O, ...)
		return O:f() + O.n

but call methods with the colon syntax:


Your proposal is ambiguous syntax:
	a = b
is the same as
	a = b:method()