lua-users home
lua-l archive

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


Hi,

> When ?!$@ are possible: why doesn't use Lua one of this chars for
> special identifiers instead of <underscore><uppercase>? I would like to
> use my own namespace*s* and this isn't easy because _... is the only
> possibility to start with a non-letter?

According  to the documentation and source code, you can't use the 
characters ?!$@ in identifiers.

There are probably sereval ways to implement different namespaces in
Lua. I think that the most natural way is to create a table and put all
protected symbols in it. Something like:

local namespace = {}
namespace.x = 2
print(namespace.x)

Regards,
Diego.