lua-users home
lua-l archive

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


> Has anyone ever thought variables should be local by default?

No, several people agree.

> I personally find it somewhat backwards declaring 'local',
> and this is showing up more now that you can thread lua.

Indeed.

> Maybe I am the minority here but I would rather specify
> scope for global variables when needed, and have variables
> act as if declared local by default.

So would many of us. But there are problems, e.g. do you have to declare
all globals inside every function? Every block? In particular, what about
global functions you call? Then there's backwards compatibility to worry
about...

If you have to declare all variables, it's rather easier. Alternatively,
see my proposal on lua-users.org.

-- 
http://www.mupsych.org/rrt/ | competent, a.  underpromoted