These are chat archives for ChaiScript/ChaiScript

20th
Nov 2016
StanEpp
@StanEpp
Nov 20 2016 13:11
@lefticus First of all, great talks at CppCon. I really enjoyed them! And great work on ChaiScript!
I would like to know if it is possible to clear the state of a script without saving the initial state somewhere. Currently I'm doing this:
chaiscript::ChaiScript chai;
chaiscript::ChaiScript::State s = chai.get_state(); // get initial state
// .... do something with the script ... 
chai.set_state(s);
Jason Turner
@lefticus
Nov 20 2016 15:36
@StanEpp You can clear the state, sure, but you'd be resetting it to essentially undefined state where nothing would work correctly. What you are doing right now is the most correct thing you can do.
Jason Turner
@lefticus
Nov 20 2016 15:55
@StanEpp also, depending on what your needs are, it might make sense to just recreate the entire chaiscript engine, I tried to make that process fast. At least "fast enough"
StanEpp
@StanEpp
Nov 20 2016 17:33
Great, then I'll leave everything as it is. Thank you!