lua-users home
lua-l archive

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


> but just to avoid having to worry that something might go wrong and
> polluting the globals table you could simply define a table of your
> own (...)  Then instead of writing, for instance:
>
> somestatevar = {1, 2, 3}
>
> if you named your table e.g. "engine" you would write:
>
> engine.somestatevar = {1, 2, 3}

Yes, this was exactly my idea. I'd just gather all my variables into
one table. And then I wanted to take that idea further by implementing
a mechanism like the following:

engine = nil
stdin:1: attempt to assign to a read-only variable

But I think I'll just write into the documentation: "Don't ever delete
(or re-assign) this variable, you'll be unable to access the system at
all." That should solve the problem. ;-)

Anyway, ευχαριστώ πολύ.

Peter