Created
February 21, 2015 23:34
-
-
Save tmladek/df5293c23594acb51208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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);"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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