lua-users home
lua-l archive

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


Hello,

 

Open the editor, and copy the attached code snippet :

 

local laneFunc = function()

end

 

require "lanes"

local lane_gen = lanes.gen(laneFunc)

local lane_h = lane_gen()

return true

 

Then start the debugger, step until after the lane_h variable is assigned, and hover the mouse cursor over the lane_h variable, and the debugger will terminate itself with «quitting debugger » in the log. It would seem that this happens because the userdata contained in lane_h doesn’t have a __tostring() metamethod. At least when considering this trace from a more complex app :

 

...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: C:\Program Files\Lua\5.1\lua\lanes.lua:189: Unknown key: __tostring

stack traceback:

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1485: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1484>

                [C]: ?

                [C]: in function 'assert'

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:701>

                Launcher_ConsolesPanel.wlua:84: in function 'refreshFromNeighborhood'

                Launcher_ConsolesPanel.wlua:648: in function <Launcher_ConsolesPanel.wlua:646>

                (tail call): ?

                [C]: in function 'MainLoop'

                Launcher.wlua:87: in main chunk

                [C]: ?

 

                local lane_h_MT= getmetatable( lane_h)

                lane_h_MT.__tostring = function() return "hello" end

 

before inspecting the variable doesn’t solve the problem. What can I do to fix this ?

 

 

Thanks,

 

B. Germain