Open JMLX42 opened 10 years ago
Namespaces in C++ are syntax sugar. I don't think there's any good way for me to automatically pull out the namespace information.
I can provide a bit of manual "sugar" like the Class method, but call it Namespace("namespace name here"). I was actually thinking about doing that at one point.
something like:
glue.Namespace("minko").Namespace("scene").Class<Node>("Node") // ...
The only reason I didn't add it, is it wasn't a priority.
Just re-read your comment, I could potentially parse out the namespace info from the class name. I might look into that too. but parsing that out would add some overhead to every Class() call.
Hello,
I would like to add support for namespaces in LuaGlue. My goal is to make it possible to have this C++ namespaced class:
declared in lua as:
The proper way to do this would be to inject the following Lua code:
Now it would be cool to have a Namespace function (comparable to your Class and Method functions). How can I add that?
Maybe calling that Namespace automatically when the class name passed to Class() has dot characters could be cool too...