lua-users home
lua-l archive

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


zhiguo zhao wrote:
> Why I first require lanes failed, but it works after call tostring?

Nope, it doesn't really work. It probably just doesn't print the
error the 2nd time.

> > print(tostring)
> function: fast#14

Lanes tries to do some strange things with the tostring()
function. It expects this to be a plain C function which can be
called from a different state. But tostring() is not a plain C
function in LuaJIT (as you can see above).

>From looking at the Lanes source code, it seems to use the string
returned from tostring() as a key to a cache for tables. I won't
go into why that is an exceptionally bad idea -- the fact that
tostring() will call any __tostring metamethods should be enough
to discredit that approach. IOW: Lanes needs to be fixed.

--Mike