Last active
January 14, 2017 08:08
-
-
Save marty1885/cd2cd992915fcad511df71a3419ae49b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <chaiscript/chaiscript.hpp> | |
int main() | |
{ | |
chaiscript::ChaiScript chai; | |
//Do all the common initialization for you script here | |
/* | |
... | |
*/ | |
//Save the current state of the ChaiScript interpolator | |
auto state = chai.get_state(); | |
//load main.chai | |
chai.use("main.chai"); | |
chai.eval("foo();");//foo() from main.chai | |
//Reset the state of the interpolator to the previous one | |
chai.set_state(state); | |
//Load main2.chai | |
chai.use("main2.chai"); | |
chai.eval("foo();");//foo() from main2.chai | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment