Reduce cost of including chaiscript.hpp

- ChaiScript no longer includes or automatically instantiates std lib
 - ChaiScript constructor now requires an std lib instance in the form
   of a ModulePtr object
 - This new layout facilitates better usage of compilation firewalls and
   factories for reducing the overall impact of ChaiScript on a project
This commit is contained in:
Jason Turner
2011-12-27 21:37:00 -07:00
parent 9a9d4e1ae0
commit 136b877afa
20 changed files with 72 additions and 56 deletions

View File

@@ -1,6 +1,7 @@
// Tests to make sure that the order in which function dispatches occur is correct
#include <chaiscript/utility/utility.hpp>
#include <chaiscript/chaiscript_stdlib.hpp>
int test_one(const int &)
{
@@ -14,7 +15,7 @@ int test_two(int &)
int main()
{
chaiscript::ChaiScript chai;
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library());
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; }");