lua-users home
lua-l archive

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


> Suppose the local keyword was generalised to a local shortcut generator so:
> 
> local foo, bar, lua : a_table_ref
> 
> Means that within the current lexical scope, "foo" means 
> "a_table_ref[foo]", etc.

I think you mean a_table_ref.foo, not a_table_ref[foo].

Anyway, it's pretty easy to write a token filter that expands
	local a,b in env
to
	local _E = env
	local a = _E.a
	local b = _E.b
(using a unique name for _E of course, say _E89238923489.)

But, like Rici Said, has a different semantics because it freezes the values
at declaration time.
--lhf