[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Overdoing 'local' (Was: [ANN] luaposix 33.4.0 released)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 28 Feb 2016 08:32:34 +0200
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.