summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 09:17:04 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-05 09:17:04 +0000
commitb0372fca69bbcb44dfb6d5b95cc103defbb6b061 (patch)
tree8950a24179a3d7d2ec5a996ed3892614cbf978fc /sca-cpp/trunk
parentaea45d997631d931d0b34dce129707027cb5040a (diff)
Minor cleanup, removed unused poolptr and char value types.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@895954 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/kernel/value.hpp95
-rw-r--r--sca-cpp/trunk/modules/python/eval.hpp4
-rw-r--r--sca-cpp/trunk/modules/scheme/primitive.hpp2
3 files changed, 1 insertions, 100 deletions
diff --git a/sca-cpp/trunk/kernel/value.hpp b/sca-cpp/trunk/kernel/value.hpp
index df85f51cff..a6c3fbd3f7 100644
--- a/sca-cpp/trunk/kernel/value.hpp
+++ b/sca-cpp/trunk/kernel/value.hpp
@@ -93,7 +93,7 @@ class value {
public:
enum ValueType {
- Undefined, Symbol, String, List, Number, Bool, Char, Lambda, Ptr, PoolPtr
+ Undefined, Symbol, String, List, Number, Bool, Lambda, Ptr
};
value() : type(value::Undefined) {
@@ -119,12 +119,8 @@ public:
num() = v.num();
case value::Bool:
boo() = v.boo();
- case value::Char:
- chr() = v.chr();
case value::Ptr:
ptr() = v.ptr();
- case value::PoolPtr:
- poolptr() = v.poolptr();
default:
break;
}
@@ -185,25 +181,11 @@ public:
debug_watchValue();
}
- value(const char chr) : type(value::Char), data(vdata(result(chr))) {
- debug_inc(countValues);
- debug_inc(countVValues);
- debug_watchValue();
- }
-
-#ifdef _GC_REFCOUNT
value(const gc_ptr<value> ptr) : type(value::Ptr), data(vdata(result(ptr))) {
debug_inc(countValues);
debug_inc(countVValues);
debug_watchValue();
}
-#endif
-
- value(const gc_ptr<value> ptr) : type(value::PoolPtr), data(vdata(result(ptr))) {
- debug_inc(countValues);
- debug_inc(countVValues);
- debug_watchValue();
- }
value(const failable<value>& m) : type(value::List),
data(vdata(result(hasContent(m)? mklist<value>(content(m)) : mklist<value>(value(), reason(m))))) {
@@ -236,12 +218,8 @@ public:
num() = v.num();
case value::Bool:
boo() = v.boo();
- case value::Char:
- chr() = v.chr();
case value::Ptr:
ptr() = v.ptr();
- case value::PoolPtr:
- poolptr() = v.poolptr();
default:
break;
}
@@ -272,12 +250,8 @@ public:
return num()() == (double)v;
case value::Bool:
return boo()() == (bool)v;
- case value::Char:
- return chr()() == (char)v;
case value::Ptr:
return v.type == value::Ptr && ptr()() == v.ptr()();
- case value::PoolPtr:
- return v.type == value::PoolPtr && poolptr()() == v.poolptr()();
default:
return false;
}
@@ -296,8 +270,6 @@ public:
return boo()() < (bool)v;
case value::Number:
return num()() < (double)v;
- case value::Char:
- return chr()() < (char)v;
default:
return false;
}
@@ -316,8 +288,6 @@ public:
return boo()() > (bool)v;
case value::Number:
return num()() > (double)v;
- case value::Char:
- return chr()() > (char)v;
default:
return false;
}
@@ -339,11 +309,6 @@ public:
}
case value::Bool:
return boo()()? trueString : falseString;
- case value::Char: {
- ostringstream os;
- os << chr()();
- return tuscany::str(os);
- }
default:
return emptyString;
}
@@ -358,8 +323,6 @@ public:
return (double)num()();
case value::Bool:
return boo()()? 1.0 : 0.0;
- case value::Char:
- return (double)chr()();
default:
return 0.0;
}
@@ -374,8 +337,6 @@ public:
return (int)num()();
case value::Bool:
return boo()()? 1 : 0;
- case value::Char:
- return (int)chr()();
default:
return 0;
}
@@ -390,38 +351,14 @@ public:
return (int)num()() != 0;
case value::Bool:
return boo()();
- case value::Char:
- return (int)chr()() != 0;
- default:
- return 0;
- }
- }
-
- operator const char() const {
- switch(type) {
- case value::Symbol:
- case value::String:
- return 0;
- case value::Number:
- return (char)num()();
- case value::Bool:
- return (char)boo()();
- case value::Char:
- return chr()();
default:
return 0;
}
}
-#ifdef _GC_REFCOUNT
operator const gc_ptr<value>() const {
return ptr()();
}
-#endif
-
- operator const gc_ptr<value>() const {
- return poolptr()();
- }
operator const list<value>() const {
return lst()();
@@ -452,18 +389,10 @@ private:
return vdata<bool()> ();
}
- lambda<char()>& chr() const {
- return vdata<char()> ();
- }
-
lambda<gc_ptr<value>()>& ptr() const {
return vdata<gc_ptr<value>()> ();
}
- lambda<gc_ptr<value>()>& poolptr() const {
- return vdata<gc_ptr<value>()> ();
- }
-
lambda<string()>& str() const {
return vdata<string()> ();
}
@@ -536,20 +465,12 @@ ostream& operator<<(ostream& out, const value& v) {
return out << "true";
else
return out << "false";
- case value::Char:
- return out << v.chr()();
case value::Ptr: {
const gc_ptr<value> p = v.ptr()();
if (p == gc_ptr<value>(NULL))
return out << "gc_ptr::null";
return out << "gc_ptr::" << p;
}
- case value::PoolPtr: {
- const gc_ptr<value> p = v.poolptr()();
- if (p == gc_ptr<value>(NULL))
- return out << "pool_ptr::null";
- return out << "pool_ptr::" << p;
- }
default:
return out << "undefined";
}
@@ -612,13 +533,6 @@ const bool isBool(const value& v) {
}
/**
- * Returns true if a value is a character.
- */
-const bool isChar(const value& v) {
- return type(v) == value::Char;
-}
-
-/**
* Returns true if a value is a pointer.
*/
const bool isPtr(const value& v) {
@@ -626,13 +540,6 @@ const bool isPtr(const value& v) {
}
/**
- * Returns true if a value is a pooled pointer.
- */
-const bool isPoolPtr(const value& v) {
- return type(v) == value::PoolPtr;
-}
-
-/**
* Returns true if a value is a tagged list.
*/
const bool isTaggedList(const value& exp, value tag) {
diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp
index 8d709731a6..8759534eff 100644
--- a/sca-cpp/trunk/modules/python/eval.hpp
+++ b/sca-cpp/trunk/modules/python/eval.hpp
@@ -150,10 +150,6 @@ PyObject* valueToPyObject(const value& v) {
return PyFloat_FromDouble((double)v);
case value::Bool:
return (bool)v? Py_True : Py_False;
- case value::Char:
- return PyInt_FromLong((long)((char)v));
- case value::Ptr:
- return NULL;
default:
return NULL;
}
diff --git a/sca-cpp/trunk/modules/scheme/primitive.hpp b/sca-cpp/trunk/modules/scheme/primitive.hpp
index 95db5dd7a2..606cb309b5 100644
--- a/sca-cpp/trunk/modules/scheme/primitive.hpp
+++ b/sca-cpp/trunk/modules/scheme/primitive.hpp
@@ -189,8 +189,6 @@ const bool isSelfEvaluating(const value& exp) {
return true;
if(isBool(exp))
return true;
- if(isChar(exp))
- return true;
if(isLambda(exp))
return true;
return false;