These are chat archives for ChaiScript/ChaiScript
there's one thing which I cannot find anything in the docs about though, and it's this:
suppose I have a chai file and a chaiscript::ChaiScript object in C++, and suppose I want to load the chai file into the chaiscript::ChaiScript object, then later, call some functions from the C++-side defined in the chai file.
1) Is this possible?
2) If so, does state get preserved between calls?
For instance, if I define a global
global i = 0; in a chai file and a chai function that increments that value, can I at a later point in time retrieve that global from the chai file and read it on the C++-side?
chaiscript.use("my file.chai"), is it as straightforward as calling
chaiscript.eval("foo();")if I want to call the chai function
fooa bunch of times?