Throw eval exception if a variable or function is redefined #28

This commit is contained in:
Jason Turner
2012-05-16 11:40:43 -06:00
parent 7deb2311f5
commit 4bcaa75fa4
9 changed files with 83 additions and 29 deletions

View File

@@ -17,7 +17,7 @@ int main()
chaiscript::ChaiScript chai;
chai.eval("def test_fun(x) { return 3; }");
chai.eval("def test_fun(x) : x == \"hi\" { return 4; }");
chai.eval("def test_fun(x) { return 5; }");
// chai.eval("def test_fun(x) { return 5; }");
chai.add(chaiscript::fun(&test_one), "test_fun");
chai.add(chaiscript::fun(&test_two), "test_fun");