diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-05 09:16:18 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-05 09:16:18 +0000 |
commit | bedb446cefc80f6d0ae5ba93f7adae8f408e3710 (patch) | |
tree | 43fa1defc43b644a291e50d1bed51780dbefba9f /sca-cpp/trunk/modules/server | |
parent | 4b5f7060b6ed80c7cf03cf0294df4536d4b217d5 (diff) |
Refactored eval module to avoid confusion with the python eval module.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@895952 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/server')
-rw-r--r-- | sca-cpp/trunk/modules/server/mod-cpp.hpp | 6 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/server/mod-eval.cpp | 6 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/server/mod-scheme.hpp (renamed from sca-cpp/trunk/modules/server/mod-scm.hpp) | 20 |
3 files changed, 14 insertions, 18 deletions
diff --git a/sca-cpp/trunk/modules/server/mod-cpp.hpp b/sca-cpp/trunk/modules/server/mod-cpp.hpp index 17d44e1428..93abd84590 100644 --- a/sca-cpp/trunk/modules/server/mod-cpp.hpp +++ b/sca-cpp/trunk/modules/server/mod-cpp.hpp @@ -36,13 +36,12 @@ #include "debug.hpp" #include "monad.hpp" #include "dynlib.hpp" -#include "../eval/driver.hpp" +#include "../scheme/driver.hpp" #include "../http/httpd.hpp" namespace tuscany { namespace server { -namespace modeval { -namespace cpp { +namespace modcpp { /** * Evaluate a C++ component implementation function. @@ -75,6 +74,5 @@ const failable<lambda<value(const list<value>&)> > readImplementation(const stri } } } -} #endif /* tuscany_modcpp_hpp */ diff --git a/sca-cpp/trunk/modules/server/mod-eval.cpp b/sca-cpp/trunk/modules/server/mod-eval.cpp index 8e8870dd52..c5e71e108c 100644 --- a/sca-cpp/trunk/modules/server/mod-eval.cpp +++ b/sca-cpp/trunk/modules/server/mod-eval.cpp @@ -36,7 +36,7 @@ #include "../scdl/scdl.hpp" #include "../http/curl.hpp" #include "../http/httpd.hpp" -#include "mod-scm.hpp" +#include "mod-scheme.hpp" #include "mod-cpp.hpp" extern "C" { @@ -275,9 +275,9 @@ const list<value> proxies(const list<value>& refs, const string& base) { */ const failable<lambda<value(const list<value>&)> > readImplementation(const string& itype, const string& path, const list<value>& px) { if (contains(itype, ".scheme")) - return scm::readImplementation(path, px); + return modscheme::readImplementation(path, px); if (contains(itype, ".cpp")) - return cpp::readImplementation(path, px); + return modcpp::readImplementation(path, px); return mkfailure<lambda<value(const list<value>&)> >(string("Unsupported implementation type: ") + itype); } diff --git a/sca-cpp/trunk/modules/server/mod-scm.hpp b/sca-cpp/trunk/modules/server/mod-scheme.hpp index 887b1de968..13b4ac5760 100644 --- a/sca-cpp/trunk/modules/server/mod-scm.hpp +++ b/sca-cpp/trunk/modules/server/mod-scheme.hpp @@ -34,14 +34,13 @@ #include "value.hpp" #include "debug.hpp" #include "monad.hpp" -#include "../eval/primitive.hpp" -#include "../eval/driver.hpp" +#include "../scheme/primitive.hpp" +#include "../scheme/driver.hpp" #include "../http/httpd.hpp" namespace tuscany { namespace server { -namespace modeval { -namespace scm { +namespace modscheme { /** * Convert proxy lambdas to evaluator primitive procedures. @@ -49,7 +48,7 @@ namespace scm { const list<value> primitiveProcedures(const list<value>& l) { if (isNil(l)) return l; - return cons<value>(mklist<value>(eval::primitiveSymbol, car(l)), primitiveProcedures(cdr(l))); + return cons<value>(mklist<value>(scheme::primitiveSymbol, car(l)), primitiveProcedures(cdr(l))); } /** @@ -58,14 +57,14 @@ const list<value> primitiveProcedures(const list<value>& l) { struct evalImplementation { const value impl; const list<value> px; - evalImplementation(const value& impl, const list<value>& px) : impl(impl), px(eval::quotedParameters(primitiveProcedures(px))) { + evalImplementation(const value& impl, const list<value>& px) : impl(impl), px(scheme::quotedParameters(primitiveProcedures(px))) { } const value operator()(const list<value>& params) const { - const value expr = cons<value>(car(params), append(eval::quotedParameters(cdr(params)), px)); + const value expr = cons<value>(car(params), append(scheme::quotedParameters(cdr(params)), px)); debug(expr, "modeval::scm::evalImplementation::input"); gc_pool pool(gc_current_pool()); - eval::Env globalEnv = eval::setupEnvironment(pool); - const value val = eval::evalScript(expr, impl, globalEnv, pool); + scheme::Env globalEnv = scheme::setupEnvironment(pool); + const value val = scheme::evalScript(expr, impl, globalEnv, pool); debug(val, "modeval::scm::evalImplementation::result"); if (isNil(val)) return mklist<value>(value(), string("Could not evaluate expression")); @@ -80,7 +79,7 @@ const failable<lambda<value(const list<value>&)> > readImplementation(const stri ifstream is(path); if (fail(is)) return mkfailure<lambda<value(const list<value>&)> >(string("Could not read implementation: ") + path); - const value impl = eval::readScript(is); + const value impl = scheme::readScript(is); if (isNil(impl)) return mkfailure<lambda<value(const list<value>&)> >(string("Could not read implementation: ") + path); return lambda<value(const list<value>&)>(evalImplementation(impl, px)); @@ -89,6 +88,5 @@ const failable<lambda<value(const list<value>&)> > readImplementation(const stri } } } -} #endif /* tuscany_modscm_hpp */ |