You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm looking for some way to call a method on a Chaiscript object from C++, but I can't see anything obvious.
For example:
(Chaiscript)
class Foo{
def Foo() {}
def Bar(x) { return x + 5; }
};
(C++)
auto foo = chai.eval("Foo()");
//somehow retrieve 'Foo::Bar' as std::function<int(int)> or similar
std::cout << bar(3) << std::endl; // prints "8"
I can get the object as a chaiscript::dispatch::Dynamic_Object, but there seems to be no way to see methods on the object. get_attrs just gives me member variables, not the methods.
The text was updated successfully, but these errors were encountered:
Hi, I'm looking for some way to call a method on a Chaiscript object from C++, but I can't see anything obvious.
For example:
(Chaiscript)
(C++)
I can get the object as a
chaiscript::dispatch::Dynamic_Object
, but there seems to be no way to see methods on the object.get_attrs
just gives me member variables, not the methods.The text was updated successfully, but these errors were encountered: