lua-users home
lua-l archive

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


On Sat, Sep 4, 2010 at 10:51 AM, Romulo <romuloab@gmail.com> wrote:
> I usually use double quotes to translatable text. Single quotes are
> for constant (in the meaning of symbol/enumeration) and assert
> messages.

I've been starting to roughly follow this convention as well--i.e.
enumerations/symbols in Lua usually take the form of strings, and such
strings I single quote:

  type(o) == 'table', ast.tag == 'Return', {__mode = 'v'}, io.open(path, 'rb')

Putting symbols under a namespace, e.g. Type.foo, can also be done,
but name restrictions sometimes necessitate the form Type['function']
since Type.function is invalid.