lua-users home
lua-l archive

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


On Mon, Sep 22, 2014 at 10:37 AM, Hisham <h@hisham.hm> wrote:
... 
For the archives (and the sharp debugging eyes of lua-l), here's a
version that handles two different [{}] keys as equivalent...
 
The shortcut 

 if avoid_loops[t1] then return avoid_loops[t1] == t2 end

uses == which looks wrong. Here's a test that fails...

> t0 = {1, 2, 3}

> t1 = {1, 2, 3}

> t2 = {1, 2, 3}

> return  table_eq({[t0] = t1, [t1] = t2, [t2] = t1}, {[t0] = t2, [t2] = t1, [t2] = t2})

false


-- e