Re: function to check if a symbol in a library exists or not

  • From: Henk Boom <henk@xxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 30 Jul 2012 12:01:32 -0400

On 30 July 2012 04:24, Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx> wrote:
> This did come up before and it seems unlikely to change. Nil is a
> valid result for a symbol (null) for a start. Also pcall has no
> particular overhead on luajit so there is no real reason not to use
> it.

That's interesting! I did a bit of searching and didn't find any info
on this. Does the LuaJIT pcall/error implementation differ
significantly from Lua 5.1? I've been wondering about using
pcall/xpcall for implementing things like finally-clauses as lua
functions. In what cases are pcall/xpcall expensive or cheap?

    henk

Other related posts: