Hi all!
I have a question regarding the chai embedded interpreter in C++. Is there any kind of environment/isolation/sandbox (milion of names) while doing eval
so that the objects/variables/functions declared inside the script reside only in the environment?
Example would be
auto script = R("
hp = 10";
def attack() { hp -= 5; }
");
chai.eval(script, env1);
chai.eval(script, env2);
chai.eval("attack()", env1);
assert.true(env1["hp"], 5);
assert.true(env2["hp"], 10);
chai.boxed_cast<SomeType>(chai.eval("v"));
auto x = SomeType()
auto a = x.property("count"); auto b = x.count
print(a.to_string() + " == " + b.to_string)