load(function() end)--returns a function load(function() return {} end) --returns nil local e = {} load(function() e.h = "h"; return e end) --returns nil
How come the last two invokes return nil, and is there away around this?
Posted 29 May 2018 - 11:57 PM
load(function() end)--returns a function load(function() return {} end) --returns nil local e = {} load(function() e.h = "h"; return e end) --returns nil
Posted 30 May 2018 - 01:35 AM
Posted 30 May 2018 - 01:49 AM
Edited by valithor, 30 May 2018 - 01:49 AM.
Posted 30 May 2018 - 01:53 AM
load("return {}")
Posted 30 May 2018 - 12:13 PM
Posted 28 June 2018 - 03:40 PM
EveryOS, on 30 May 2018 - 12:32 PM, said:
local n = 0 function foo() n = n + 1 return n endIf you would use this:
load(string.dump(someFunction))It would throw something like this:
string:-1: attempt to add on nil and numberPlease use string.dump only in the case you want to save a anonymous (!) function to a file.
Edited by Sewbacca, 28 June 2018 - 03:42 PM.
0 members, 1 guests, 0 anonymous users