lua-users home
lua-l archive

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


I tried

        local q3 = SelFIFO.Find("myFifo")
        local mt = getmetatable(q3)
        mt.__index = mt
        q3:dump()

but the result is the same :
    Selenites/FIFO.sel:27: attempt to call method 'dump' (a nil value)

Anyway, it's strange it's working in my main thread and not the slave one : state initialization code is strictly the same.

Best regards,

Laurent


Le Mercredi 28 juin 2017 0h02, Sean Conner <sean@conman.org> a écrit :


It was thus said that the Great Laurent FAILLIE once stated:

> Well well well,
> I'm still facing a nasty problem that drive me nut :(
> In the slave, I'm able to retrieve my object and when I display its metatable, it's  displaying my methods :local fifo = SelFIFO.Find("toto")local mt = getmetatable(fifo)
> for k,v in pairs(mt) do print(k,v) end
> result :dump    function: 0x14ddf50
> list    function: 0x14ddf70
> Pop    function: 0x187d360
> __index    table: 0x1762aa8
> Push    function: 0x1762ad0
>
> but when I'm calling themfifo:dump()
> it's saying
>
> /home/laurent/Toile/Inputs/20_MQTTLog.lua:25: attempt to call method 'dump' (a nil value)
> I can't understand how the metatable can be filled whereas calling member raise an error :(
> Any tip welcome :)


  Does mt == mt.__index?

  -spc