Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ test.lua --]]
- local f = function()
- print"local function f in test.lua"
- end
- f_generate = function()
- local fun = loadstring(" f()")
- -- local env = getfenv(1)
- -- set(fun,env)
- return fun
- end
- f_generate()()
- --[[ end of test.lua--]]
- loadstring()
- loadstring()
- --local f = function()
- f = function()
- print"local function f in test.lua"
- end
- local table = {
- baz = {
- blah = "bar"
- },
- foo = table.baz.blah
- }
- local __cmp__table = {
- [">"] = function(a,b) return a>b end,
- [">="] = function(a,b) return a>=b end,
- ["<"] = function(a,b) return a<b end,
- ["<="] = function(a,b) return a<=b end,
- ["=="] = function(a,b) return a==b end,
- ["~="] = function(a,b) return a~=b end,
- }
- cmp = function(a, op, b)
- return __cmp__table[op](a,b)
- end
Add Comment
Please, Sign In to add comment