Lua improvements - Mark Gossage patch #1295168
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7472 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ef13b64b7e
commit
655f282468
9 changed files with 72 additions and 57 deletions
|
|
@ -1,6 +1,8 @@
|
|||
-- demo of lua swig capacilities (operator overloading)
|
||||
require("import") -- the import fn
|
||||
import("operator_overload",true) -- import lib into global
|
||||
import("operator_overload") -- import lib
|
||||
|
||||
for k,v in pairs(operator_overload) do _G[k]=v end -- move to global
|
||||
|
||||
-- catching undefined variables
|
||||
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue