lua-users home
lua-l archive

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


On Mon, Dec 6, 2010 at 4:19 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
> That's why I'm saying that you're trying to create a dialect, even if
> Lua as a language allows such changes.

Any powerful language allows bad coding practices. So style and
consistent idiom use is important.  In this case the rule could be:
"avoid idioms where local constructs require global changes".

Such shortcuts don't need global changes, could define

local function at(s,i) return s:sub(i,i) end

and you would not be typing many more characters, plus your readers
will see the explicit function call and be grateful.

steve d.