1
-- demo of lua swig capacilities (operator overloading)
2
require("import") -- the import fn
3
import("exception_order") -- import lib into global
4
eo=exception_order --alias
6
-- catching undefined variables
7
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
16
assert(ok==false and swig_type(ex)==swig_type(eo.E1()))
22
assert(ok==false and swig_type(ex)==swig_type(eo.E2()))
28
assert(ok==false and type(ex)=="string")
29
-- the SWIG_exception is just an error string