lua-users home
lua-l archive

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


2016-02-28 8:16 GMT+02:00 Sean Conner <sean@conman.org>:

> I've found that the less global variables I have, the easier it is to
> reason about the code (and that's regardless of language).

I've been using the idiom of semi-global local variables for some
time. Those are locals explicitly defined but not initialized right
at the top of the file. All other locals appear only in do-end blocks.

One _could_ (but I don't) then write a routine that exploits the
debug library to access them via strings that hold their names.