Saturday, 15 August 2015

lua 5.2 - How to dump lua function chunk to string? -



lua 5.2 - How to dump lua function chunk to string? -

how dump lua function chunk string ?

function test(a, b) local c = + b homecoming c end print( type(test) ) --> function print( test ) --> function: 0053b108 print( dumptostring(test) )

i wish dumptostring result following:

function test(a, b) local c = + b homecoming c end

how ?

=== update1 === want automatically log , inject code.

you don't why want this, may important. can dump function string, won't readable string; can store , transmit function way (between compatible lua engines):

string.dump(function() print "hello" end)

lua lua-5.2

No comments:

Post a Comment