[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why I leave Lua (Was: Re: [ANN] Lua 5.3.0 (work3) now available)
- From: Hao Wu <wuhao.wise@...>
- Date: Wed, 9 Jul 2014 18:16:17 -0700
On Wednesday, July 9, 2014, Sean Conner <sean@conman.org> wrote:
It was thus said that the Great Coroutines once stated:
>
> Another thing that seemed pretty arbitrary is that __index can be a
> table. That table can have a metatable. But the __index of that
> table that is the first __index cannot have a metatable. I just
> expect things like that to recurse, instead of being a
> first-level-only trigger. The same for __newindex.
Roberto & Co. probably did that to avoid this:
waiting = {}
longtime = {}
setmetatable(waiting , { __index = longtime} )
setmetatable(longtime , { __index = waiting } )
waiting['for'] = 'Godot'
It's technically unavoidable but it does have a check to avoid infinite loop in __index
-spc (But infinite loops are great for producing vast amounts of nothing
real quick ... )