lua-users home
lua-l archive

scope, design patterns?

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


This question may not have an answer!.....
I've achieved good results with my Lua code in a real world sense but that is only due to a lack of competition, my code has been a disgrace. I am starting a new project and want to minimize globals and use the same sort of strategies that other list members use.
I fould this page on the wiki:
http://lua-users.org/wiki/LuaScopingDiscussion
but it seems quite out of date according to this note:
""Comments on this page refer to a quite old version of Lua (2001 era) that had more limited lexical scoping and presumably non-complete closure support. Many of these comments don't apply on recent versions of Lua.""" I understand closure, functions and other tables as table values, local variables etc.. it's just that I only know a limited number of ways to assemble them for privacy. Is there something out there akin to a design patterns tutorial for Lua that illustrates various privacy patterns?
Hope everyone is enjoying time with their families this time of year-Patrick

AltStyle によって変換されたページ (->オリジナル) /