Skip to content

Instantly share code, notes, and snippets.

@tmladek
Created February 21, 2015 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmladek/df5293c23594acb51208 to your computer and use it in GitHub Desktop.
Save tmladek/df5293c23594acb51208 to your computer and use it in GitHub Desktop.
Class :: Class(){
chai.add(chaiscript::fun(&Class::func, this), "func");
// ...
initial_state = chai.get_state();
}
void Class :: exec(){
chai.set_state(initial_state);
chai.exec("var a = 2; print(2*2);");
}
class Class {
protected:
chaiscript::ChaiScript chai;
chaiscript::ChaiScript::State initial_state
void func();
public:
Class();
void exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment