[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Uppercase-initial globals
- From: Scott Morgan <blumf@...>
- Date: Wed, 22 Jun 2022 12:45:50 +0100
On 6/22/22 11:07, Ryan Starrett wrote:
Of course, you could also vouch for no naming changes and explicitly use
_G to look up the global. Some may call this ugly, but it's about as
explicit as you'll get haha.
I wonder if there's an argument, on larger projects, for something like:
====
--global.lua
return {}
====
--myappfiles*.lua
local global = require"global"
-- Init
global.foo = 123
-- etc...
====
Leaving _G to the standard libs.
Scott