KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm going back to the basics here but in Lua, you can define a table like so: myTable = {} myTable [1] = 12 Printing the table reference itself brings back a pointer to it. To access its elements you need to specify an index (i.e. exactly like you would an array) print(myTable ) --prints pointer print(myTable[1]) --prints 12 Now functions are a different story. You can define and print a function like so: myFunc = function() local x = 14 end --Defined function print(myFunc) --Printed pointer to function Is there a way to access the body of a defined function. I am trying to put together a small code visualizer and would like to 'seed' a given function with special functions/variables to allow a visualizer to 'hook' itself into the code, I would need to be able to redefine the function either from a variable or a string.
Tags (comma-separated)
Save Edits
Cancel