Tag Archives: table

see.lua – Introspecting Lua objects

As via its python equivalent, see.lua takes in an object and prints out a list of its elements as well as metatable methods in readable text.

> require "see"

> s = see(string)
.byte(?)            .char(?)            .dump(?)            .find(?)

Posted in Blog, Lua, Programming, Snippets | Tagged , , , , , , | 1 Comment

Lua – Get a table of function arguments

The lua standard libraries do not provide anything that helps you get the table of arguments for a given function. This can be accomplished by directly introspecting the bytecode of the function. The following snippet generates a function get_args that…

Posted in Blog, Lua, Programming, Snippets | Tagged , , , , , , | Leave a comment