Guest User

Untitled

a guest
Jun 14th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. --[[ test.lua --]]
  2. local f = function()
  3. print"local function f in test.lua"
  4. end
  5.  
  6. f_generate = function()
  7. local fun = loadstring(" f()")
  8. -- local env = getfenv(1)
  9. -- set(fun,env)
  10. return fun
  11. end
  12. f_generate()()
  13. --[[ end of test.lua--]]
  14.  
  15. loadstring()
  16.  
  17. loadstring()
  18.  
  19. --local f = function()
  20. f = function()
  21. print"local function f in test.lua"
  22. end
  23.  
  24. local table = {
  25. baz = {
  26. blah = "bar"
  27. },
  28. foo = table.baz.blah
  29. }
  30.  
  31. local __cmp__table = {
  32. [">"] = function(a,b) return a>b end,
  33. [">="] = function(a,b) return a>=b end,
  34. ["<"] = function(a,b) return a<b end,
  35. ["<="] = function(a,b) return a<=b end,
  36. ["=="] = function(a,b) return a==b end,
  37. ["~="] = function(a,b) return a~=b end,
  38. }
  39. cmp = function(a, op, b)
  40. return __cmp__table[op](a,b)
  41. end
Add Comment
Please, Sign In to add comment