lua-users home
lua-l archive

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


> You have a point. The syntax is simple but the semantics can get
confusing.
> The main issue is whether global declarations as proposed solve the
> perceived need for global declarations.
> --lhf

I don't usually jump in on the language discussions, but I thought I'd butt
in here. Lua has simple syntax, which make simple things easy. Lua also has
really extensible semantics, which make complex things possible and more
palatable. The drawback is that the meaning of simple-looking statements can
become hard to decipher. I'm not the most learned person here by far, but
the new semantics of the global statement seem like a step in the right
direction - or at least a lua-like direction. I think it falls into the same
'guru-level' category as some of the more arcane
fallback/tagmethod/metatable uses.

In a general sense, I think the 'global in X' would be used in places like
implementing a class system, a module system, sandboxes, and so on - places
where "heavy wizardry" is already going on. Elsewhere in code it should be
pretty transparent. And that's why I think it's OK.

--James Hearn