lua-users home
lua-l archive

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


2013/4/27 Steve Litt <slitt@troubleshooters.com>:
> On Sat, 27 Apr 2013 06:33:02 +0200
> Dirk Laurie <dirk.laurie@gmail.com> wrote:
>
>> 2013/4/26 Steve Litt <slitt@troubleshooters.com>:
>>
>> > I can't think of any reason for a global variable's
>> > existence to be conditional.
>>
>> That's because you are accustomed to having no distinction between
>> nonexistent and nil-valued global variables. Highly convenient.
>
> Under what circumstances would the distinction between nonexistant and
> nil-valued globals be convenient?

Never, as fas as I am concerned, but if we are to have compulsory
declaration of global variables, such a distinction may well come into
existence, as there at present is for locals.

> LOL, the day I use 200 variables in one function, you should shoot me
> and put me out of my misery. Long before I got to 200, just for the
> wellbeing of my brain, I'd arrange them in data structures, which for
> the purposes of Lua means tables suitably nested.

Not in a function, no, but in a module's main file, dead easy.

Suppose you belong to the cache-system-library-functions brigade,
then the system libraries alone can account for well over 100 slots.