summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpp/sca/kernel/function.hpp8
-rw-r--r--cpp/sca/kernel/gc.hpp6
-rw-r--r--cpp/sca/kernel/kernel-test.cpp8
-rw-r--r--cpp/sca/kernel/list.hpp2
-rw-r--r--cpp/sca/kernel/parallel.hpp4
-rw-r--r--cpp/sca/kernel/value.hpp16
-rw-r--r--cpp/sca/kernel/xml.hpp2
-rw-r--r--cpp/sca/modules/eval/driver.hpp3
-rw-r--r--cpp/sca/modules/eval/environment.hpp24
-rwxr-xr-xcpp/sca/modules/eval/eval-testbin335904 -> 335912 bytes
-rw-r--r--cpp/sca/modules/eval/eval-test.cpp18
-rw-r--r--cpp/sca/modules/eval/eval.hpp14
-rw-r--r--cpp/sca/modules/eval/primitive.hpp54
-rw-r--r--cpp/sca/modules/eval/read.hpp14
-rw-r--r--cpp/sca/test/store-function/cart.hpp16
-rw-r--r--cpp/sca/test/store-function/catalog.hpp10
-rw-r--r--cpp/sca/test/store-function/currency.hpp8
-rw-r--r--cpp/sca/test/store-function/item.hpp2
-rw-r--r--cpp/sca/test/store-function/store-function-test.cpp2
-rw-r--r--cpp/sca/test/store-function/store-ui.hpp24
20 files changed, 117 insertions, 118 deletions
diff --git a/cpp/sca/kernel/function.hpp b/cpp/sca/kernel/function.hpp
index caba5211b9..07b4111239 100644
--- a/cpp/sca/kernel/function.hpp
+++ b/cpp/sca/kernel/function.hpp
@@ -86,12 +86,12 @@ public:
template<typename F> class Proxy: public Callable {
public:
- explicit Proxy(const F& f) : function(f) {
+ Proxy(const F& f) : function(f) {
countProxies++;
countFProxies ++;
}
- explicit Proxy(const Proxy& p) : function(p.function) {
+ Proxy(const Proxy& p) : function(p.function) {
countProxies++;
countCProxies ++;
}
@@ -123,7 +123,7 @@ public:
countELambdas++;
}
- template<typename F> explicit lambda(const F f) : callable(0) {
+ template<typename F> lambda(const F f) : callable(0) {
typedef typename CallableType::template Proxy<F> ProxyType;
countLambdas++;
@@ -214,7 +214,7 @@ template<typename R, typename T, typename U, typename V, typename... P> const la
*/
template<typename T> class unitReturn {
public:
- explicit unitReturn(const T& v) :
+ unitReturn(const T& v) :
v(v) {
}
const T operator()() const {
diff --git a/cpp/sca/kernel/gc.hpp b/cpp/sca/kernel/gc.hpp
index b0ed42a474..0d292f6194 100644
--- a/cpp/sca/kernel/gc.hpp
+++ b/cpp/sca/kernel/gc.hpp
@@ -33,7 +33,7 @@ namespace tuscany
template<typename T> class gc_ptr {
public:
- explicit gc_ptr(T* p = 0) throw() : countingRef(p == 0? 0 : new CountingRef(p)) {
+ gc_ptr(T* p = 0) throw() : countingRef(p == 0? 0 : new CountingRef(p)) {
}
~gc_ptr() throw() {
@@ -116,7 +116,7 @@ template<typename T> std::ostream& operator<<(std::ostream& out, const gc_ptr<T>
*/
template<typename T> class gc_aptr {
public:
- explicit gc_aptr(T* p = 0) throw() : countingRef(p == 0? 0 : new CountingRef(p)) {
+ gc_aptr(T* p = 0) throw() : countingRef(p == 0? 0 : new CountingRef(p)) {
}
~gc_aptr() throw() {
@@ -199,7 +199,7 @@ template<typename T> std::ostream& operator<<(std::ostream& out, const gc_aptr<T
*/
template<typename T> class gc_counting_ptr {
public:
- explicit gc_counting_ptr(T* p = 0) throw() : ptr(p) {
+ gc_counting_ptr(T* p = 0) throw() : ptr(p) {
acquire(p);
}
diff --git a/cpp/sca/kernel/kernel-test.cpp b/cpp/sca/kernel/kernel-test.cpp
index 02bb63c928..fb3f540abd 100644
--- a/cpp/sca/kernel/kernel-test.cpp
+++ b/cpp/sca/kernel/kernel-test.cpp
@@ -248,7 +248,7 @@ bool testSeq() {
}
value valueSquare(list<value> x) {
- return value((int)car(x) * (int)car(x));
+ return (int)car(x) * (int)car(x);
}
bool testValue() {
@@ -257,7 +257,7 @@ bool testValue() {
assert(value("abcd") == value("abcd"));
lambda<value(list<value>&)> vl(valueSquare);
assert(value(vl) == value(vl));
- assert(value(makeList(value(1), value(2))) == value(makeList(value(1), value(2))));
+ assert(value(makeList<value>(1, 2)) == value(makeList<value>(1, 2)));
return true;
}
@@ -390,7 +390,7 @@ const bool isName(const value& token) {
bool testReadXML() {
std::istringstream is(currencyXML);
- const list<value> currency = value(readXML(is));
+ const list<value> currency = readXML(is);
const value composite = car(currency);
assert(isElement(composite));
@@ -403,7 +403,7 @@ bool testReadXML() {
bool testWriteXML() {
std::istringstream is(currencyXML);
- const list<value> currency = value(readXML(is));
+ const list<value> currency = readXML(is);
std::ostringstream os;
writeXML(currency, os);
assert(os.str() == currencyXML);
diff --git a/cpp/sca/kernel/list.hpp b/cpp/sca/kernel/list.hpp
index 5ee527e10c..4047e91c1b 100644
--- a/cpp/sca/kernel/list.hpp
+++ b/cpp/sca/kernel/list.hpp
@@ -269,7 +269,7 @@ template<typename T, typename R> const list<R> map(const lambda<R(T)>& f, const
*/
template<typename T, typename R> struct reduceAccumulate {
const lambda<R(R, T)> f;
- explicit reduceAccumulate(const lambda<R(R, T)>& f) :
+ reduceAccumulate(const lambda<R(R, T)>& f) :
f(f) {
}
R operator()(const R& acc, const list<T>& p) const {
diff --git a/cpp/sca/kernel/parallel.hpp b/cpp/sca/kernel/parallel.hpp
index c0d578e281..82983d9edc 100644
--- a/cpp/sca/kernel/parallel.hpp
+++ b/cpp/sca/kernel/parallel.hpp
@@ -139,7 +139,7 @@ public:
*/
template<typename T> class queue {
public:
- explicit queue(int max) : max(max), size(0), tail(0), head(0), values(new T[max]) {
+ queue(int max) : max(max), size(0), tail(0), head(0), values(new T[max]) {
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&full, NULL);
pthread_cond_init(&empty, NULL);
@@ -221,7 +221,7 @@ const list<pthread_t> makeWorkerThreads(queue<lambda<bool()> >& queue, const int
*/
class worker {
public:
- explicit worker(int max) : work(queue<lambda<bool()> >(max)), threads(makeWorkerThreads(work, max)) {
+ worker(int max) : work(queue<lambda<bool()> >(max)), threads(makeWorkerThreads(work, max)) {
}
private:
diff --git a/cpp/sca/kernel/value.hpp b/cpp/sca/kernel/value.hpp
index ca4bd06ca6..184773baec 100644
--- a/cpp/sca/kernel/value.hpp
+++ b/cpp/sca/kernel/value.hpp
@@ -121,49 +121,49 @@ public:
countValues--;
}
- explicit value(const lambda<value(list<value>&)>& func) :
+ value(const lambda<value(list<value>&)>& func) :
type(value::Lambda), data(vdata(func)) {
countValues++;
countVValues++;
}
- explicit value(const std::string& str) :
+ value(const std::string& str) :
type(value::String), data(vdata(unit(str))) {
countValues++;
countVValues++;
}
- explicit value(const char* str) :
+ value(const char* str) :
type(value::Symbol), data(vdata(unit(std::string(str)))) {
countValues++;
countVValues++;
}
- explicit value(const list<value>& lst) :
+ value(const list<value>& lst) :
type(value::List), data(vdata(unit(lst))) {
countValues++;
countVValues++;
}
- explicit value(const double num) :
+ value(const double num) :
type(value::Number), data(vdata(unit(num))) {
countValues++;
countVValues++;
}
- explicit value(const int num) :
+ value(const int num) :
type(value::Number), data(vdata(unit((double)num))) {
countValues++;
countVValues++;
}
- explicit value(const bool boo) :
+ value(const bool boo) :
type(value::Boolean), data(vdata(unit(boo))) {
countValues++;
countVValues++;
}
- explicit value(const char chr) :
+ value(const char chr) :
type(value::Character), data(vdata(unit(chr))) {
countValues++;
countVValues++;
diff --git a/cpp/sca/kernel/xml.hpp b/cpp/sca/kernel/xml.hpp
index b4a3b87ad1..0065b23268 100644
--- a/cpp/sca/kernel/xml.hpp
+++ b/cpp/sca/kernel/xml.hpp
@@ -46,7 +46,7 @@ public:
None = 0, Element = 1, Attribute = 2, EndElement = 15, Identifier = 100, Text = 101, End = 103
};
- explicit XmlReader(xmlTextReaderPtr xml) : xml(xml), tokenType(None) {
+ XmlReader(xmlTextReaderPtr xml) : xml(xml), tokenType(None) {
xmlTextReaderSetParserProp(xml, XML_PARSER_DEFAULTATTRS, 1);
xmlTextReaderSetParserProp(xml, XML_PARSER_SUBST_ENTITIES, 1);
}
diff --git a/cpp/sca/modules/eval/driver.hpp b/cpp/sca/modules/eval/driver.hpp
index 582f4f1b08..c45a6a1a6d 100644
--- a/cpp/sca/modules/eval/driver.hpp
+++ b/cpp/sca/modules/eval/driver.hpp
@@ -48,8 +48,7 @@ const bool announceOutput(std::ostream& out, const std::string str) {
const bool userPrint(std::ostream& out, const value object) {
if(isCompoundProcedure(object))
- out << makeList(compoundProcedureSymbol, value(procedureParameters(object)), value(procedureBody(object)), value(
- "<procedure-env>"));
+ out << makeList<value>(compoundProcedureSymbol, procedureParameters(object), procedureBody(object), "<procedure-env>");
out << object;
return true;
}
diff --git a/cpp/sca/modules/eval/environment.hpp b/cpp/sca/modules/eval/environment.hpp
index 46c1716cd8..4abf558cfa 100644
--- a/cpp/sca/modules/eval/environment.hpp
+++ b/cpp/sca/modules/eval/environment.hpp
@@ -37,11 +37,11 @@ namespace tuscany
typedef value Frame;
typedef list<value> Env;
-const value trueSymbol = value("true");
-const value falseSymbol = value("false");
-const value defineSymbol = value("define");
-const value setSymbol = value("set!");
-const value dotSymbol = value(".");
+const value trueSymbol("true");
+const value falseSymbol("false");
+const value defineSymbol("define");
+const value setSymbol("set!");
+const value dotSymbol(".");
const Env theEmptyEnvironment() {
return list<value>();
@@ -86,7 +86,7 @@ const Frame makeBinding(const Frame& frameSoFar, const list<value>& variables, c
return frameSoFar;
}
if (isDotVariable(car(variables)))
- return makeBinding(frameSoFar, cdr(variables), makeList(value(values)));
+ return makeBinding(frameSoFar, cdr(variables), makeList<value>(values));
if (values == list<value>()) {
if (variables != list<value>())
@@ -96,13 +96,13 @@ const Frame makeBinding(const Frame& frameSoFar, const list<value>& variables, c
const list<value> vars = cons(car(variables), frameVariables(frameSoFar));
const list<value> vals = cons(car(values), frameValues(frameSoFar));
- const Frame newFrame = value(cons(value(vars), vals));
+ const Frame newFrame = cons(value(vars), vals);
return makeBinding(newFrame, cdr(variables), cdr(values));
}
const Frame makeFrame(const list<value>& variables, const list<value> values) {
- const Frame emptyFrame = value(cons((value)list<value>(), list<value>()));
+ const Frame emptyFrame = cons(value(list<value>()), list<value>());
return makeBinding(emptyFrame, variables, values);
}
@@ -131,11 +131,11 @@ const value assignmentValue(const value& exp) {
}
const Frame addBindingToFrame(const value& var, const value& val, const Frame& frame) {
- return value(cons((value)cons(var, frameVariables(frame)), cons(val, frameValues(frame))));
+ return cons(value(cons(var, frameVariables(frame))), cons(val, frameValues(frame)));
}
const Env defineVariable(const value& var, const value& val, Env& env) {
- return value(cons(addBindingToFrame(var, val, firstFrame(env)), cdr(env)));
+ return cons(addBindingToFrame(var, val, firstFrame(env)), cdr(env));
}
const Env extendEnvironment(const list<value>& vars, const list<value>& vals, const Env& baseEnv) {
@@ -150,8 +150,8 @@ const Env extendEnvironment(const list<value>& vars, const list<value>& vals, co
const Env setupEnvironment() {
Env env = extendEnvironment(primitiveProcedureNames(), primitiveProcedureObjects(), theEmptyEnvironment());
- env = defineVariable(trueSymbol, value(true), env);
- env = defineVariable(falseSymbol, value(false), env);
+ env = defineVariable(trueSymbol, true, env);
+ env = defineVariable(falseSymbol, false, env);
return env;
}
diff --git a/cpp/sca/modules/eval/eval-test b/cpp/sca/modules/eval/eval-test
index ff394153d1..5505bfd1e8 100755
--- a/cpp/sca/modules/eval/eval-test
+++ b/cpp/sca/modules/eval/eval-test
Binary files differ
diff --git a/cpp/sca/modules/eval/eval-test.cpp b/cpp/sca/modules/eval/eval-test.cpp
index c8c86a1666..81f03f1c5e 100644
--- a/cpp/sca/modules/eval/eval-test.cpp
+++ b/cpp/sca/modules/eval/eval-test.cpp
@@ -33,10 +33,10 @@ namespace tuscany {
bool testEnv() {
Env globalEnv = list<value>();
- Env env = extendEnvironment(makeList(value("a")), makeList(value(1)), globalEnv);
- defineVariable(value("x"), value(env), env);
+ Env env = extendEnvironment(makeList<value>("a"), makeList<value>(1), globalEnv);
+ defineVariable("x", env, env);
//assert(lookupVariableValue(value("x"), env) == env);
- assert(lookupVariableValue(value("a"), env) == value(1));
+ assert(lookupVariableValue("a", env) == value(1));
return true;
}
@@ -56,19 +56,19 @@ bool testEnvGC() {
bool testRead() {
std::istringstream is("abcd");
- assert(read(is) == value("abcd"));
+ assert(read(is) == "abcd");
std::istringstream is2("123");
assert(read(is2) == value(123));
std::istringstream is3("(abcd)");
- assert(read(is3) == value(makeList(value("abcd"))));
+ assert(read(is3) == makeList(value("abcd")));
std::istringstream is4("(abcd xyz)");
- assert(read(is4) == value(makeList(value("abcd"), value("xyz"))));
+ assert(read(is4) == makeList<value>("abcd", "xyz"));
std::istringstream is5("(abcd (xyz tuv))");
- assert(read(is5) == value(makeList(value("abcd"), value(makeList(value("xyz"), value("tuv"))))));
+ assert(read(is5) == makeList<value>("abcd", makeList<value>("xyz", "tuv")));
return true;
}
@@ -133,10 +133,10 @@ bool testEval() {
}
bool testEvalExpr() {
- const value exp = value(makeList(value("+"), value(2), value(3)));
+ const value exp = makeList<value>("+", 2, 3);
Env env = setupEnvironment();
const value r = eval(exp, env);
- assert(value(5) == r);
+ assert(r == value(5));
return true;
}
diff --git a/cpp/sca/modules/eval/eval.hpp b/cpp/sca/modules/eval/eval.hpp
index 28e1d01ffc..783f5c6447 100644
--- a/cpp/sca/modules/eval/eval.hpp
+++ b/cpp/sca/modules/eval/eval.hpp
@@ -67,7 +67,7 @@ static list<value> lambdaBody(const value& exp) {
}
const value makeProcedure(const list<value>& parameters, const value& body, const Env& env) {
- return value(makeList(procedureSymbol, value(parameters), body, value(env)));
+ return makeList<value>(procedureSymbol, parameters, body, env);
}
const bool isApply(const value& exp) {
@@ -129,7 +129,7 @@ const list<value> restExp(const list<value>& seq) {
}
const value makeBegin(const list<value> seq) {
- return value(cons(beginSymbol, seq));
+ return cons(beginSymbol, seq);
}
const value evalSequence(const list<value>& exps, Env& env) {
@@ -152,7 +152,7 @@ const value applyProcedure(const value& procedure, list<value>& arguments) {
const value sequenceToExp(const list<value> exps) {
if(exps == list<value> ())
- return value(list<value>());
+ return list<value>();
if(isLastExp(exps))
return firstExp(exps);
return makeBegin(exps);
@@ -181,7 +181,7 @@ const value ifConsequent(const value& exp) {
const value ifAlternative(const value& exp) {
if(cdr(cdr(cdr((list<value> )exp))) != list<value> ())
return car(cdr(cdr(cdr((list<value> )exp))));
- return value(false);
+ return false;
}
const bool isCond(const value& exp) {
@@ -197,12 +197,12 @@ const bool isIf(const value& exp) {
}
const value makeIf(value predicate, value consequent, value alternative) {
- return value(makeList(ifSymbol, predicate, consequent, alternative));
+ return makeList(ifSymbol, predicate, consequent, alternative);
}
const value expandClauses(const list<value>& clauses) {
if(clauses == list<value> ())
- return value(false);
+ return false;
const value first = car(clauses);
const list<value> rest = cdr(clauses);
if(isCondElseClause(first)) {
@@ -243,7 +243,7 @@ const value eval(const value& exp, Env& env) {
if(isCond(exp))
return eval(condToIf(exp), env);
if(isLambda(exp))
- return makeProcedure(lambdaParameters(exp), value(lambdaBody(exp)), env);
+ return makeProcedure(lambdaParameters(exp), lambdaBody(exp), env);
if(isVariable(exp))
return lookupVariableValue(exp, env);
if(isApply(exp)) {
diff --git a/cpp/sca/modules/eval/primitive.hpp b/cpp/sca/modules/eval/primitive.hpp
index 04e26178f4..5ee74fa5d4 100644
--- a/cpp/sca/modules/eval/primitive.hpp
+++ b/cpp/sca/modules/eval/primitive.hpp
@@ -50,53 +50,53 @@ const value valueCar(list<value>& args) {
}
const value valueCdr(list<value>& args) {
- return value(cdr((list<value> )car(args)));
+ return cdr((list<value> )car(args));
}
const value valueCons(list<value>& args) {
- return value(cons(car(args), (list<value> )cadr(args)));
+ return cons(car(args), (list<value> )cadr(args));
}
const value valueList(list<value>& args) {
- return value(args);
+ return args;
}
const value valueNul(list<value>& args) {
- return value((bool)isNil(car(args)));
+ return (bool)isNil(car(args));
}
const value valueEqual(list<value>& args) {
- return value((bool)(car(args) == cadr(args)));
+ return (bool)(car(args) == cadr(args));
}
const value valueAdd(list<value>& args) {
if (cdr(args) == list<value>())
- return value((double)car(args));
- return value((double)car(args) + (double)cadr(args));
+ return (double)car(args);
+ return (double)car(args) + (double)cadr(args);
}
const value valueSub(list<value>& args) {
if (cdr(args) == list<value>())
- return value(0 - (double)car(args));
- return value((double)car(args) - (double)cadr(args));
+ return (double)0 - (double)car(args);
+ return (double)car(args) - (double)cadr(args);
}
const value valueMul(list<value>& args) {
- return value((double)car(args) * (double)cadr(args));
+ return (double)car(args) * (double)cadr(args);
}
const value valueDiv(list<value>& args) {
- return value((double)car(args) / (double)cadr(args));
+ return (double)car(args) / (double)cadr(args);
}
const value valueDisplay(list<value>& args) {
*evalOut << car(args);
- return value(true);
+ return true;
}
const value valueError(list<value>& args) {
std::cerr << (std::string)car(args);
- return value(true);
+ return true;
}
const value applyPrimitiveProcedure(const value& proc, list<value>& args) {
@@ -127,22 +127,22 @@ const value primitiveImplementation(const list<value>& proc) {
}
template<typename F> const value primitiveProcedure(const F& f) {
- return value(makeList(primitiveSymbol, value((lambda<value(list<value>&)>)f)));
+ return makeList<value>(primitiveSymbol, (lambda<value(list<value>&)>)f);
}
const list<value> primitiveProcedureNames() {
- list<value> l = makeList(value("car"));
- l = cons(value("cdr"), l);
- l = cons(value("cons"), l);
- l = cons(value("list"), l);
- l = cons(value("nul"), l);
- l = cons(value("="), l);
- l = cons(value("+"), l);
- l = cons(value("-"), l);
- l = cons(value("*"), l);
- l = cons(value("/"), l);
- l = cons(value("equal?"), l);
- l = cons(value("display"), l);
+ list<value> l = makeList<value>("car");
+ l = cons<value>("cdr", l);
+ l = cons<value>("cons", l);
+ l = cons<value>("list", l);
+ l = cons<value>("nul", l);
+ l = cons<value>("=", l);
+ l = cons<value>("+", l);
+ l = cons<value>("-", l);
+ l = cons<value>("*", l);
+ l = cons<value>("/", l);
+ l = cons<value>("equal?", l);
+ l = cons<value>("display", l);
return l;
}
@@ -179,7 +179,7 @@ const value textOfQuotation(const value& exp) {
}
const value makeLambda(const list<value>& parameters, const list<value>& body) {
- return value(cons(lambdaSymbol, cons((value)parameters, body)));
+ return cons(lambdaSymbol, cons<value>(parameters, body));
}
}
diff --git a/cpp/sca/modules/eval/read.hpp b/cpp/sca/modules/eval/read.hpp
index cd9068c017..6baf670a1e 100644
--- a/cpp/sca/modules/eval/read.hpp
+++ b/cpp/sca/modules/eval/read.hpp
@@ -38,8 +38,8 @@
namespace tuscany
{
-const value rightParenthesis(makeList(value(")")));
-const value leftParenthesis(makeList(value("(")));
+const value rightParenthesis(makeList<value>(")"));
+const value leftParenthesis(makeList<value>("("));
const double stringToNumber(const std::string& str) {
double d;
@@ -120,7 +120,7 @@ const value readToken(std::istream& in) {
}
const value readQuoted(std::istream& in) {
- return value(makeList(quoteSymbol, read(in)));
+ return makeList(quoteSymbol, read(in));
}
const list<value> readList(const list<value>& listSoFar, std::istream& in) {
@@ -146,7 +146,7 @@ const list<char> readIdentifierHelper(const list<char>& listSoFar, std::istream&
}
const value readIdentifier(const char chr, std::istream& in) {
- return value(listToString(readIdentifierHelper(makeList(chr), in)).c_str());
+ return listToString(readIdentifierHelper(makeList(chr), in)).c_str();
}
const list<char> readStringHelper(const list<char>& listSoFar, std::istream& in) {
@@ -157,7 +157,7 @@ const list<char> readStringHelper(const list<char>& listSoFar, std::istream& in)
}
const value readString(const char chr, std::istream& in) {
- return value(listToString(readStringHelper(list<char>(), in)));
+ return listToString(readStringHelper(list<char>(), in));
}
const list<char> readNumberHelper(const list<char>& listSoFar, std::istream& in) {
@@ -168,13 +168,13 @@ const list<char> readNumberHelper(const list<char>& listSoFar, std::istream& in)
}
const value readNumber(const char chr, std::istream& in) {
- return value(stringToNumber(listToString(readNumberHelper(makeList(chr), in))));
+ return stringToNumber(listToString(readNumberHelper(makeList(chr), in)));
}
const value read(std::istream& in) {
const value nextToken = readToken(in);
if(isLeftParenthesis(nextToken))
- return value(readList(list<value> (), in));
+ return readList(list<value> (), in);
return nextToken;
}
diff --git a/cpp/sca/test/store-function/cart.hpp b/cpp/sca/test/store-function/cart.hpp
index c21e509487..f3b0f6195e 100644
--- a/cpp/sca/test/store-function/cart.hpp
+++ b/cpp/sca/test/store-function/cart.hpp
@@ -55,14 +55,14 @@ const double shoppingCart_getTotal() {
}
const tuscany::value shoppingCart_service(const tuscany::list<tuscany::value>& args) {
- if (car(args) == tuscany::value("getAll"))
- return tuscany::value(shoppingCart_getAll());
- if (car(args) == tuscany::value("post"))
- return tuscany::value(shoppingCart_post(cadr(args)));
- if (car(args) == tuscany::value("deleteAll"))
- return tuscany::value(shoppingCart_deleteAll());
- if (car(args) == tuscany::value("getTotal"))
- return tuscany::value(shoppingCart_getTotal());
+ if (car(args) == "getAll")
+ return shoppingCart_getAll();
+ if (car(args) == "post")
+ return shoppingCart_post(cadr(args));
+ if (car(args) == "deleteAll")
+ return shoppingCart_deleteAll();
+ if (car(args) == "getTotal")
+ return shoppingCart_getTotal();
return tuscany::value();
}
diff --git a/cpp/sca/test/store-function/catalog.hpp b/cpp/sca/test/store-function/catalog.hpp
index 82a69e2bbd..7bf54231a7 100644
--- a/cpp/sca/test/store-function/catalog.hpp
+++ b/cpp/sca/test/store-function/catalog.hpp
@@ -33,20 +33,20 @@ namespace store
std::string catalog_currencyCode = "USD";
double catalog_convert(const service& currencyConverter, const double price) {
- return currencyConverter(makeList(tuscany::value("convert"), tuscany::value("USD"), tuscany::value(catalog_currencyCode), tuscany::value(price)));
+ return currencyConverter(tuscany::makeList<tuscany::value>("convert", "USD", catalog_currencyCode, price));
}
const tuscany::list<ItemType> catalog_get(const service& currencyConverter) {
- const std::string currencySymbol = currencyConverter_service(makeList(tuscany::value("getSymbol"), tuscany::value(catalog_currencyCode)));
- return makeList(
+ const std::string currencySymbol = currencyConverter_service(tuscany::makeList<tuscany::value>("getSymbol", catalog_currencyCode));
+ return tuscany::makeList(
makeItem("Apple", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 2.99)),
makeItem("Orange", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 3.55)),
makeItem("Pear", catalog_currencyCode, currencySymbol, catalog_convert(currencyConverter, 1.55)));
}
const tuscany::value catalog_service(const service& currencyConverter, const tuscany::list<tuscany::value>& args) {
- if (car(args) == tuscany::value("get"))
- return tuscany::value(catalog_get(currencyConverter));
+ if (car(args) == "get")
+ return catalog_get(currencyConverter);
return tuscany::value();
}
diff --git a/cpp/sca/test/store-function/currency.hpp b/cpp/sca/test/store-function/currency.hpp
index ce7e4f464b..453a5e1e81 100644
--- a/cpp/sca/test/store-function/currency.hpp
+++ b/cpp/sca/test/store-function/currency.hpp
@@ -47,10 +47,10 @@ const std::string currencyConverter_getSymbol(const std::string& currencyCode) {
}
const tuscany::value currencyConverter_service(const tuscany::list<tuscany::value>& args) {
- if (car(args) == tuscany::value("convert"))
- return tuscany::value(currencyConverter_convert(cadr(args), car(cdr(cdr(args))), car(cdr(cdr(cdr(args))))));
- if (car(args) == tuscany::value("getSymbol"))
- return tuscany::value(currencyConverter_getSymbol(cadr(args)));
+ if (car(args) == "convert")
+ return currencyConverter_convert(cadr(args), car(cdr(cdr(args))), car(cdr(cdr(cdr(args)))));
+ if (car(args) == "getSymbol")
+ return currencyConverter_getSymbol(cadr(args));
return tuscany::value();
}
diff --git a/cpp/sca/test/store-function/item.hpp b/cpp/sca/test/store-function/item.hpp
index 8a121124a3..40d18b4ce1 100644
--- a/cpp/sca/test/store-function/item.hpp
+++ b/cpp/sca/test/store-function/item.hpp
@@ -31,7 +31,7 @@ namespace store
typedef tuscany::value ItemType;
const ItemType makeItem(const std::string& name, const std::string& currencyCode, const std::string& currencySymbol, const double price) {
- return tuscany::value(makeList(tuscany::value(name), tuscany::value(currencyCode), tuscany::value(currencySymbol), tuscany::value(price)));
+ return tuscany::makeList<tuscany::value>(name, currencyCode, currencySymbol, price);
}
const std::string itemName(const ItemType& item) {
diff --git a/cpp/sca/test/store-function/store-function-test.cpp b/cpp/sca/test/store-function/store-function-test.cpp
index e71ecfd633..604b33acff 100644
--- a/cpp/sca/test/store-function/store-function-test.cpp
+++ b/cpp/sca/test/store-function/store-function-test.cpp
@@ -33,7 +33,7 @@ namespace store
bool testComponentAssembly() {
const service store(storeSolution_service);
- assert(length((tuscany::list<tuscany::value>)store(makeList(tuscany::value("getCatalog")))) == 3);
+ assert(length((tuscany::list<tuscany::value>)store(tuscany::makeList<tuscany::value>("getCatalog"))) == 3);
return true;
}
diff --git a/cpp/sca/test/store-function/store-ui.hpp b/cpp/sca/test/store-function/store-ui.hpp
index 9b100a6793..a2748547d5 100644
--- a/cpp/sca/test/store-function/store-ui.hpp
+++ b/cpp/sca/test/store-function/store-ui.hpp
@@ -33,30 +33,30 @@ namespace store
{
const tuscany::list<ItemType> storeUI_getCatalog(const service& catalog) {
- return catalog(makeList(tuscany::value("get")));
+ return catalog(tuscany::makeList<tuscany::value>("get"));
}
const tuscany::list<ItemType> storeUI_getCart(const service& cart) {
- return cart(makeList(tuscany::value("getAll")));
+ return cart(tuscany::makeList<tuscany::value>("getAll"));
}
const double storeUI_getTotal(const service& cart) {
- return cart(makeList(tuscany::value("getTotal")));
+ return cart(tuscany::makeList<tuscany::value>("getTotal"));
}
const bool storeUI_post(const service& cart, const ItemType& item) {
- return cart(makeList(tuscany::value("post"), tuscany::value(item)));
+ return cart(tuscany::makeList<tuscany::value>("post", item));
}
const tuscany::value storeUI_service(const service& catalog, const service& cart, const tuscany::list<tuscany::value>& args) {
- if (car(args) == tuscany::value("getCatalog"))
- return tuscany::value(storeUI_getCatalog(catalog));
- if (car(args) == tuscany::value("getCart"))
- return tuscany::value(storeUI_getCart(cart));
- if (car(args) == tuscany::value("getTotal"))
- return tuscany::value(storeUI_getTotal(cart));
- if (car(args) == tuscany::value("post"))
- return tuscany::value(storeUI_post(cart, cadr(args)));
+ if (car(args) == "getCatalog")
+ return storeUI_getCatalog(catalog);
+ if (car(args) == "getCart")
+ return storeUI_getCart(cart);
+ if (car(args) == "getTotal")
+ return storeUI_getTotal(cart);
+ if (car(args) == "post")
+ return storeUI_post(cart, cadr(args));
return tuscany::value();
}