lua-users home
lua-l archive

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


On 13/06/2014 4:13 PM, Thomas Jericke wrote:
I'll leave it to others to determine whether using string literals in
an interface is ever good style.

Ross.


Show me a Lua API that doesn't use string literals.

local myLib = require "MyLib" -- Oops a string literal
myLib.myFunction()
-- which is syntactic sugar for:
myLib["myFunction"]() -- Oops, another one.

So without sting literals, you cannot use globals, require, access table
elements of type string.

You're intentionally twisting my words.

It's one thing to be able to use a string literal, quite enough to require its use in an interface.

We're not talking about module or function names here, we're talking about constants that are usually integers.

Ross.