Skip to content

Instantly share code, notes, and snippets.

@marty1885 marty1885/doubleload.cpp
Last active Jan 14, 2017

Embed
What would you like to do?
#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
You can’t perform that action at this time.