lua-users home
lua-l archive

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


Hey,
This topic comes up regularly, so you may want to review previous
posts on the topic: (e.g. search the GMane Loom for "global local
default" sorted by date)
http://search.gmane.org/?query=global+local+default&author=&group=gmane.comp.lang.lua.general&sort=date&DEFAULTOP=and&xP=Zglobal%09Zlocal%09Zdefault&xFILTERS=Gcomp.lang.lua.general---A

2008/4/29 Anticept <anticept@anticeptsworld.net>:
> Good Day everyone,
>   I would like to ask why Lua scope is global default? I have tried combing
> the message boards for a reason as to why this is set to work this way, but
> to no avail. I do not mean any insult to anyone, but isn't this a bad
> practice, especially for an embeddable language? With many games using this
> language to allow customization and modification to the game itself, I find
> this becomes prone to errors, particularly for new programmers.
>
>   For example, the game "Garry's Mod" uses Lua to create the tools and
> functions of the game to interact with the environment. However, often many
> new and experienced programmers alike sometimes overlook scope during the
> course of their programming, and this creates subtle conflicts that
> sometimes break down the game experience. Also, very often, as many
> modifications are installed to the game, these subtle conflicts can cause
> catastrophe, and make bug squashing very very difficult, as by themselves,
> these modifications work flawlessly.
>
>   Is there a possibility of Lua moving away from this? Or perhaps, allowing
> the embedding programmer to change the default scope?
>
>   I thank you for your time! :-)
>   -Corey
>