LuaBridge icon indicating copy to clipboard operation
LuaBridge copied to clipboard

Reflection Interface

Open psyinf opened this issue 13 years ago • 1 comments

I currently using LuaBridge with great success. There is one feature however all users could need: Reflection The problem with the script interfaces is that they have to be known on the lua-side in detail. I could imagine an interface that allows inspection of registered classes/functions which would return a textual representation of the class/function and the parameters. Of course we would need to put additional information into the C++-registration part.

I.e. given a namespace ns:

ns.help ->

class MyClass;

ns.MyClass.help -> MyClass { function addFoo(double foo double bar); function addBar(); }

ns.MyClass.addFoo.help

addFoo(double foo double bar);

What do you think about something like this? Th example above might not be the best way to do it, and I realize I could provide the help functon on my own, but this way I'd have to keep it in sync if I change the interface. At least the function names and parameters could be derived "automagically" as they are put to a table somewhere.

psyinf avatar Feb 05 '13 10:02 psyinf

This is a good idea.

vinniefalco avatar Feb 05 '13 14:02 vinniefalco