Re: [LuaJIT ffi] Misleading error message?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [LuaJIT ffi] Misleading error message?
- From: Mike Pall <mikelu-1107@...>
- Date: 2011年7月23日 17:15:15 +0200
Xavier Wang wrote:
> I see, maybe providing another function to lookup symbols is better ?
>
> ffi.lookup("C", "foobar") -- nil, "no such symbol"
Easy enough to add this yourself:
local function plookup(ns, sym) return ns[sym] end
function ffi.lookup(ns, sym) return pcall(plookup, ns, sym) end
print(ffi.lookup(ffi.C, "foobar"))
--Mike