summaryrefslogtreecommitdiffstats
path: root/cpp/sca/kernel/value.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-26 05:13:06 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2009-10-26 05:13:06 +0000
commitf61164c77c5c21a32b58ad61c868bd8ff6a4a79e (patch)
tree951cc581d22bac8ad615697b19e879e22578d10c /cpp/sca/kernel/value.hpp
parent0969cc21d093f9450c36e7f63cddc4f5aa44b238 (diff)
Minor refactoring, given each module its own namespace. Added utility functions to convert between values elements/attributes and fixed XML, ATOM and JSON serialization of lists.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@829699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--cpp/sca/kernel/value.hpp41
1 files changed, 9 insertions, 32 deletions
diff --git a/cpp/sca/kernel/value.hpp b/cpp/sca/kernel/value.hpp
index a8140d4892..d57264ff43 100644
--- a/cpp/sca/kernel/value.hpp
+++ b/cpp/sca/kernel/value.hpp
@@ -324,24 +324,24 @@ private:
std::ostream& operator<<(std::ostream& out, const value& v) {
switch(v.type) {
case value::List:
- return out << "List::" << v.lst()();
+ return out << v.lst()();
case value::Lambda:
- return out << "Lambda::" << v.func();
+ return out << "lambda::" << v.func();
case value::Symbol:
- return out << "Symbol::" << v.str()();
+ return out << "symbol::" << v.str()();
case value::String:
- return out << "String::" << '\"' << v.str()() << '\"';
+ return out << "string::" << '\"' << v.str()() << '\"';
case value::Number:
- return out << "Number::" << v.num()();
+ return out << "number::" << v.num()();
case value::Boolean:
if(v.boo()())
- return out << "Boolean::" << "true";
+ return out << "bool::" << "true";
else
- return out << "Boolean::" << "false";
+ return out << "bool::" << "false";
case value::Character:
- return out << "Character::" << v.chr()();
+ return out << "char::" << v.chr()();
default:
- return out << "Undefined";
+ return out << "undefined";
}
}
@@ -383,28 +383,5 @@ const bool isTaggedList(const value& exp, value tag) {
return false;
}
-/**
- * Pretty print a list of values.
- */
-std::ostream& print(const list<value>& l, std::ostream& os) {
- os << "(";
- if (!isNil(l)) {
- list<value> ml = l;
- while(true) {
- const value v = car(ml);
- if (isList(v))
- print(list<value>(v), os);
- else
- os << v;
- ml = cdr(ml);
- if (isNil(ml))
- break;
- os << ", ";
- }
- }
- os << ")";
- return os;
-}
-
}
#endif /* tuscany_value_hpp */