lua-users home
lua-l archive

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


>Oh! Big move for OOP-like programming style.
>
>function class_instance:method()
>         globals in self
>
>         initialize()
>end

That was not the primary motivation for introducting "global", but it works.
Just note that "globals in self" routes *all* undeclared variables to "self":
you'd have to declare global functions and such if you use them.
--lhf