It'd be damn sexy to be able to pass a user type to a Chai function and have it be able to access the type's (public) member variables directly, instead of everything being handled via functions (accessor and mutator could be written, but this would be a lovely convenience).
Add example of wrapping data members of a class #79
I'm not sure exactly what you have in mind. I just committed an example of access a C++ member from ChaiScript, with no accessor needed. Is this what you had in mind?
Very sexy, though not very intuitive. Using chaiscript::fun for members does seem a bit misleading; something like chaiscript::member or chaiscript::property would be most straightforward. Though I'm not quite sure if you're clarifying what I was requesting or suggesting a possible (though not yet implemented) solution.
Thanks for the reply.
That code works and is now officially part of the unit tests. The function has been there since the beginning. The concept was to make the interface as simple as possible so "fun" is any type of member or function. "constructor" is special because they are not regular functions. You cannot make a pointer to a constructor.
Ahh, got it. Thanks for the clarification, Jason (and thanks for ChaiScript!). Things are working beautifully now.