lua-users home
lua-l archive

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

"Murray S. Kucherawy" <> writes:
>   -- test script; "ctx" is a global context pointer exported from C
>   io.write(xfoo(ctx, "hi there"), "\n")
> ...lua_load() doesn't complain at all.  Only if I use lua_pcall() will
> I get some kind of error report out.

lua_load _can't_ complain, because there is no syntax error.
Lua doesn't know that xfoo is nil until it evaluates it.

Try the same thing after deleting the final parentheses from the test
script (so it has mismatched parentheses) for instance, and you'll get
an error report from lua_load.


"Most attacks seem to take place at night, during a rainstorm, uphill,
 where four map sheets join."   -- Anon. British Officer in WW I