summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/util.py
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 08:10:25 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2013-01-03 08:10:25 +0000
commit2853156a2bce535bcaa440c37cf872916f76c03b (patch)
tree8e161033a9bac8274dcaca05940964b91cdb2bfc /sca-cpp/trunk/hosting/server/util.py
parent55607ea78e10832838d52fdb17cbdfe4355c3265 (diff)
Refactoring, rename isNil to isNull.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1428206 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/hosting/server/util.py')
-rw-r--r--sca-cpp/trunk/hosting/server/util.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sca-cpp/trunk/hosting/server/util.py b/sca-cpp/trunk/hosting/server/util.py
index 791951a71c..bd37eb11af 100644
--- a/sca-cpp/trunk/hosting/server/util.py
+++ b/sca-cpp/trunk/hosting/server/util.py
@@ -57,9 +57,9 @@ def reverse(l):
r.reverse()
return tuple(r)
-def isNil(l):
+def isNull(l):
if isinstance(l, streampair):
- return l.isNil()
+ return l.isNull()
return l is None or l == ()
def isSymbol(v):
@@ -76,7 +76,7 @@ def isList(v):
return True
def isTaggedList(v, t):
- return isList(v) and not isNil(v) and car(v) == t
+ return isList(v) and not isNull(v) and car(v) == t
# Scheme-like streams
@@ -88,7 +88,7 @@ class streampair(object):
def __repr__(self):
return repr(self[0:len(self)])
- def isNil(self):
+ def isNull(self):
return self.cdr == ()
def __len__(self):
@@ -102,7 +102,7 @@ class streampair(object):
return self.cdr()[i - 1]
def __getslice__(self, i, j):
- if isNil(self):
+ if isNull(self):
return ()
if i > 0:
if j == maxint:
@@ -156,7 +156,7 @@ def curry(f, *args):
# Convert a path represented as a list of values to a string
def path(p):
- if isNil(p):
+ if isNull(p):
return ""
return "/" + car(p) + path(cdr(p))