lua-users home
lua-l archive

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


On Sat, Oct 02, 2004 at 08:24:50AM -0300, Milano Carvalho wrote:
> I think that this meaning would be extended to table constructors as well:
>    The statement
>        local t = { ... }
> 
>    translates to
>        local t; t = { ... }

> Is there some drawback of doing this change?

Yes. It's horribly inconsistent. This would work:

local t = {f = function() print(t) end}

But this wouldn't:

local t = {f = t}

What you're really after is something like OCaml's 'let rec', but that
would be rather hard to shoehorn into the semantics of an imperative
language, especially since it's not always desirable.

-- Jamie Webb