lua-users home
lua-l archive

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


On Fri, Apr 26, 2013 at 1:13 PM, Thomas Jericke <tjericke@indel.ch> wrote:
It would also help editors a lot if they don't need to do reference resolving to highlight globals.

We should not to be too kind to editors, they can be taught to be clever ;)

Ah, but would your proposal also mean .tostring and .table.concat?  Dots everywhere? That feels clumsy, somehow.

A thought experiment - a global-free Lua.  Every compiled chunk has upvalues for everything in the usual _G (there's 40 of them for 5.1) and anything not recognized is just an error - no more globals. But this does put a burden on those little chunks which we so happily dynamically load.  I think it ultimately is expecting the language to do too much;  making it too strict would take away that freedom that attracted us to Lua in the first place.  Rather, let a combination of static tools and runtime strictness add the constraints needed for the particular mission.  I don't fly without a static checker anymore, it catches things that I'd never see and that are problems in waiting.