summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/atomutil.js46
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/elemutil.js32
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/jsonutil.js12
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/scdl.js22
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/ui.js18
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/util.js24
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/xmlutil.js22
-rw-r--r--sca-cpp/trunk/modules/json/json.hpp14
8 files changed, 95 insertions, 95 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/atomutil.js b/sca-cpp/trunk/modules/js/htdocs/atomutil.js
index 3d4e9d08d2..4b57b36fb4 100644
--- a/sca-cpp/trunk/modules/js/htdocs/atomutil.js
+++ b/sca-cpp/trunk/modules/js/htdocs/atomutil.js
@@ -27,22 +27,22 @@ var atom = {};
*/
atom.entryElementValues = function(e) {
var lt = filter(selector(mklist(element, "'title")), e);
- var t = mklist(element, "'title", isNil(lt)? '' : elementValue(car(lt)));
+ var t = mklist(element, "'title", isNull(lt)? '' : elementValue(car(lt)));
var li = filter(selector(mklist(element, "'id")), e);
- var i = mklist(element, "'id", isNil(li)? '' : elementValue(car(li)));
+ var i = mklist(element, "'id", isNull(li)? '' : elementValue(car(li)));
var la = filter(selector(mklist(element, "'author")), e);
- var lan = isNil(la)? mklist() : filter(selector(mklist(element, "'name")), car(la));
- var lae = isNil(la)? mklist() : filter(selector(mklist(element, "'email")), car(la));
- var laa = isNil(lan)? lae : lan;
- var a = isNil(laa)? mklist() : mklist(mklist(element, "'author", elementValue(car(laa))));
+ var lan = isNull(la)? mklist() : filter(selector(mklist(element, "'name")), car(la));
+ var lae = isNull(la)? mklist() : filter(selector(mklist(element, "'email")), car(la));
+ var laa = isNull(lan)? lae : lan;
+ var a = isNull(laa)? mklist() : mklist(mklist(element, "'author", elementValue(car(laa))));
var lu = filter(selector(mklist(element, "'updated")), e);
- var u = isNil(lu)? mklist() : mklist(mklist(element, "'updated", elementValue(car(lu))));
+ var u = isNull(lu)? mklist() : mklist(mklist(element, "'updated", elementValue(car(lu))));
var lc = filter(selector(mklist(element, "'content")), e);
- var c = isNil(lc)? mklist() : isAttribute(elementValue(car(lc)))? mklist() : mklist(mklist(element, "'content", elementValue(car(lc))));
+ var c = isNull(lc)? mklist() : isAttribute(elementValue(car(lc)))? mklist() : mklist(mklist(element, "'content", elementValue(car(lc))));
return append(append(append(mklist(element, "'entry", t, i), a), u), c);
};
@@ -51,7 +51,7 @@ atom.entryElementValues = function(e) {
* Convert a list of elements to a list of values representing ATOM entries.
*/
atom.entriesElementValues = function(e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return cons(atom.entryElementValues(car(e)), atom.entriesElementValues(cdr(e)));
};
@@ -70,7 +70,7 @@ atom.isATOMEntry = function(l) {
*/
atom.readATOMEntryDocument = function(doc) {
var e = readXMLDocument(doc);
- if (isNil(e))
+ if (isNull(e))
return mklist();
return mklist(atom.entryElementValues(car(e)));
};
@@ -96,7 +96,7 @@ atom.isATOMFeed = function(l) {
*/
atom.readATOMFeedDocument = function(doc) {
var f = readXMLDocument(doc);
- if (isNil(f))
+ if (isNull(f))
return mklist();
var t = filter(selector(mklist(element, "'title")), car(f));
var i = filter(selector(mklist(element, "'id")), car(f));
@@ -120,17 +120,17 @@ atom.entryElement = function(l) {
var title = elementValue(namedElementChild("'title", l));
var id = elementValue(namedElementChild("'id", l));
var author = namedElementChild("'author", l);
- var email = isNil(author)? false : (elementValue(author).indexOf('@') != -1);
+ var email = isNull(author)? false : (elementValue(author).indexOf('@') != -1);
var updated = namedElementChild("'updated", l);
var content = namedElementChild("'content", l);
- var text = isNil(content)? false : elementHasValue(content);
+ var text = isNull(content)? false : elementHasValue(content);
return append(append(append(append(
mklist(element, "'entry", mklist(attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
mklist(element, "'title", mklist(attribute, "'type", "text"), title), mklist(element, "'id", id)),
- isNil(author)? mklist() : mklist(mklist(element, "'author",
+ isNull(author)? mklist() : mklist(mklist(element, "'author",
(email? mklist(element, "'email", elementValue(author)) : mklist(element, "'name", elementValue(author)))))),
- isNil(updated)? mklist() : mklist(mklist(element, "'updated", elementValue(updated)))),
- isNil(content)? mklist() :
+ isNull(updated)? mklist() : mklist(mklist(element, "'updated", elementValue(updated)))),
+ isNull(content)? mklist() :
mklist(append(mklist(element, "'content", mklist(attribute, "'type", text? "text" : "application/xml")),
text? mklist(elementValue(content)) : elementChildren(content)))),
mklist(mklist(element, "'link", mklist(attribute, "'href", id))));
@@ -140,7 +140,7 @@ atom.entryElement = function(l) {
* Convert a list of values representing ATOM entries to a list of elements.
*/
atom.entriesElements = function(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(atom.entryElement(car(l)), atom.entriesElements(cdr(l)));
};
@@ -149,7 +149,7 @@ atom.entriesElements = function(l) {
* Convert a list of values representing an ATOM entry to an ATOM entry.
*/
atom.writeATOMEntry = function(ll) {
- var l = isNil(ll)? ll : car(ll);
+ var l = isNull(ll)? ll : car(ll);
return writeXML(mklist(atom.entryElement(l)), true);
};
@@ -157,22 +157,22 @@ atom.writeATOMEntry = function(ll) {
* Convert a list of values representing an ATOM feed to an ATOM feed.
*/
atom.writeATOMFeed = function(ll) {
- var l = isNil(ll)? ll : car(ll);
+ var l = isNull(ll)? ll : car(ll);
var lt = filter(selector(mklist(element, "'title")), l);
- var t = isNil(lt)? '' : elementValue(car(lt));
+ var t = isNull(lt)? '' : elementValue(car(lt));
var li = filter(selector(mklist(element, "'id")), l);
- var i = isNil(li)? '' : elementValue(car(li));
+ var i = isNull(li)? '' : elementValue(car(li));
var f = mklist(element, "'feed", mklist(attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
mklist(element, "'title", mklist(attribute, "'type", "text"), car(l)),
mklist(element, "'id", cadr(l)));
// Write ATOM entries
var le = filter(selector(mklist(element, "'entry")), l);
- if (isNil(le))
+ if (isNull(le))
return writeXML(mklist(f), true);
// Write a single ATOM entry element with a list of values
- if (!isNil(le) && !isNil(car(le)) && isList(car(caddr(car(le))))) {
+ if (!isNull(le) && !isNull(car(le)) && isList(car(caddr(car(le))))) {
var fe = append(f, atom.entriesElements(caddr(car(le))));
return writeXML(mklist(fe), true);
}
diff --git a/sca-cpp/trunk/modules/js/htdocs/elemutil.js b/sca-cpp/trunk/modules/js/htdocs/elemutil.js
index 37d641f7b3..62050f5953 100644
--- a/sca-cpp/trunk/modules/js/htdocs/elemutil.js
+++ b/sca-cpp/trunk/modules/js/htdocs/elemutil.js
@@ -29,14 +29,14 @@ var atsign = "'@"
* Return true if a value is an element.
*/
function isElement(v) {
- return (!(!isList(v) || isNil(v) || car(v) != element));
+ return (!(!isList(v) || isNull(v) || car(v) != element));
}
/**
* Return true if a value is an attribute.
*/
function isAttribute(v) {
- return (!(!isList(v) || isNil(v) || car(v) != attribute));
+ return (!(!isList(v) || isNull(v) || car(v) != attribute));
}
/**
@@ -58,7 +58,7 @@ elementName = cadr;
* Return true if an element has children.
*/
function elementHasChildren(l) {
- return !isNil(cddr(l));
+ return !isNull(cddr(l));
}
/**
@@ -73,7 +73,7 @@ function elementHasValue(l) {
var r = reverse(l);
if (isSymbol(car(r)))
return false;
- return (!(isList(car(r)) && !isNil(car(r)) && isSymbol(car(car(r)))))
+ return (!(isList(car(r)) && !isNull(car(r)) && isSymbol(car(car(r)))))
}
/**
@@ -89,7 +89,7 @@ function elementValue(l) {
function elementToValueIsList(v) {
if (!isList(v))
return false;
- return isNil(v) || !isSymbol(car(v));
+ return isNull(v) || !isSymbol(car(v));
}
function elementToValue(t) {
@@ -112,11 +112,11 @@ function elementToValue(t) {
* Convert a list of elements to a list of values.
*/
function elementToValueIsSymbol(v) {
- return (!(!isList(v)) || isNil(v) || !isSymbol(car(v)));
+ return (!(!isList(v)) || isNull(v) || !isSymbol(car(v)));
}
function elementToValueGroupValues(v, l) {
- if (isNil(l) || !elementToValueIsSymbol(v) || !elementToValueIsSymbol(car(l)))
+ if (isNull(l) || !elementToValueIsSymbol(v) || !elementToValueIsSymbol(car(l)))
return cons(v, l);
if (car(car(l)) != car(v))
return cons(v, l);
@@ -129,7 +129,7 @@ function elementToValueGroupValues(v, l) {
}
function elementsToValues(e) {
- if (isNil(e))
+ if (isNull(e))
return e;
return elementToValueGroupValues(elementToValue(car(e)), elementsToValues(cdr(e)));
}
@@ -138,15 +138,15 @@ function elementsToValues(e) {
* Convert a value to an element.
*/
function valueToElement(t) {
- if (isList(t) && !isNil(t) && isSymbol(car(t))) {
+ if (isList(t) && !isNull(t) && isSymbol(car(t))) {
var n = car(t);
- var v = isNil(cdr(t))? mklist() : cadr(t);
+ var v = isNull(cdr(t))? mklist() : cadr(t);
if (!isList(v)) {
if (n.substring(0, 2) == atsign)
return mklist(attribute, "'" + n.substring(2), v);
return mklist(element, n, v);
}
- if (isNil(v) || !isSymbol(car(v)))
+ if (isNull(v) || !isSymbol(car(v)))
return cons(element, cons(n, mklist(valuesToElements(v))));
return cons(element, cons(n, valuesToElements(cdr(t))));
}
@@ -159,7 +159,7 @@ function valueToElement(t) {
* Convert a list of values to a list of elements.
*/
function valuesToElements(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(valueToElement(car(l)), valuesToElements(cdr(l)));
}
@@ -169,9 +169,9 @@ function valuesToElements(l) {
*/
function selector(s) {
function evalSelect(s, v) {
- if (isNil(s))
+ if (isNull(s))
return true;
- if (isNil(v))
+ if (isNull(v))
return false;
if (car(s) != car(v))
return false;
@@ -187,7 +187,7 @@ function selector(s) {
function namedAttribute(name, l) {
return memo(l, name, function() {
var f = filter(function(v) { return isAttribute(v) && attributeName(v) == name; }, l);
- if (isNil(f))
+ if (isNull(f))
return null;
return car(f);
});
@@ -217,7 +217,7 @@ function namedElementChildren(name, l) {
*/
function namedElementChild(name, l) {
var f = namedElementChildren(name, l);
- if (isNil(f))
+ if (isNull(f))
return null;
return car(f);
}
diff --git a/sca-cpp/trunk/modules/js/htdocs/jsonutil.js b/sca-cpp/trunk/modules/js/htdocs/jsonutil.js
index 8aa291bc89..9960a5d82f 100644
--- a/sca-cpp/trunk/modules/js/htdocs/jsonutil.js
+++ b/sca-cpp/trunk/modules/js/htdocs/jsonutil.js
@@ -41,13 +41,13 @@ json.Exception.prototype.toString = function() {
* Return true if a list represents a JS array.
*/
json.isJSArray = function(l) {
- if (isNil(l))
+ if (isNull(l))
return true;
var v = car(l);
if (isSymbol(v))
return false;
if (isList(v))
- if (!isNil(v) && isSymbol(car(v)))
+ if (!isNull(v) && isSymbol(car(v)))
return false;
return true;
};
@@ -56,7 +56,7 @@ json.isJSArray = function(l) {
* Converts JSON properties to values.
*/
json.jsPropertiesToValues = function(propertiesSoFar, o, i) {
- if (isNil(i))
+ if (isNull(i))
return propertiesSoFar;
var p = car(i);
var jsv = o[p];
@@ -92,7 +92,7 @@ json.jsValToValue = function(jsv) {
* Return true if a list of strings contains a JSON document.
*/
json.isJSON = function(l) {
- if (isNil(l))
+ if (isNull(l))
return false;
var s = car(l).slice(0, 1);
return s == "[" || s == "{";
@@ -112,7 +112,7 @@ json.readJSON = function(l) {
* Convert a list of values to JSON array elements.
*/
json.valuesToJSElements = function(a, l, i) {
- if (isNil(l))
+ if (isNull(l))
return a;
var pv = json.valueToJSVal(car(l));
a[i] = pv
@@ -134,7 +134,7 @@ json.valueToJSVal = function(v) {
* Convert a list of values to JSON properties.
*/
json.valuesToJSProperties = function(o, l) {
- if (isNil(l))
+ if (isNull(l))
return o;
var token = car(l);
if (isTaggedList(token, attribute)) {
diff --git a/sca-cpp/trunk/modules/js/htdocs/scdl.js b/sca-cpp/trunk/modules/js/htdocs/scdl.js
index 50dab53e7c..fd0e08035f 100644
--- a/sca-cpp/trunk/modules/js/htdocs/scdl.js
+++ b/sca-cpp/trunk/modules/js/htdocs/scdl.js
@@ -27,7 +27,7 @@ var scdl = {};
*/
scdl.composite = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return car(cs);
};
@@ -37,7 +37,7 @@ scdl.composite = function(l) {
*/
scdl.components = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return namedElementChildren("'component", car(cs));
};
@@ -47,7 +47,7 @@ scdl.components = function(l) {
*/
scdl.promotions = function(l) {
var cs = namedElementChildren("'composite", l);
- if (isNil(cs))
+ if (isNull(cs))
return cs;
return namedElementChildren("'service", car(cs));
};
@@ -57,7 +57,7 @@ scdl.promotions = function(l) {
*/
scdl.promote = function(l) {
var puri = namedAttributeValue("'promote", l);
- if (isNil(puri))
+ if (isNull(puri))
return puri;
return car(tokens(puri));
};
@@ -74,7 +74,7 @@ scdl.name = function(l) {
*/
scdl.documentation = function(l) {
var d = namedElementChildren("'documentation", l);
- if (isNil(d))
+ if (isNull(d))
return null;
if (!elementHasValue(car(d)))
return null;
@@ -126,7 +126,7 @@ scdl.implementation = function(l) {
}
var n = filter(filterImplementation, l);
- if (isNil(n))
+ if (isNull(n))
return null;
return car(n);
};
@@ -204,21 +204,21 @@ scdl.bindingType = function(l) {
scdl.target = function(l) {
function targetURI() {
function bindingsTarget(l) {
- if (isNil(l))
+ if (isNull(l))
return null;
var u = scdl.uri(car(l));
- if (!isNil(u))
+ if (!isNull(u))
return u;
return bindingsTarget(cdr(l));
}
var t = namedAttributeValue("'target", l);
- if (!isNil(t))
+ if (!isNull(t))
return t;
return bindingsTarget(scdl.bindings(l));
}
var turi = targetURI();
- if (isNil(turi))
+ if (isNull(turi))
return turi;
return car(tokens(turi));
};
@@ -243,7 +243,7 @@ scdl.propertyValue = function(l) {
* Convert a list of elements to a name -> element assoc list.
*/
scdl.nameToElementAssoc = function(l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(mklist(scdl.name(car(l)), car(l)), scdl.nameToElementAssoc(cdr(l)));
};
diff --git a/sca-cpp/trunk/modules/js/htdocs/ui.js b/sca-cpp/trunk/modules/js/htdocs/ui.js
index 0c80b92bcf..3aa9e1052a 100644
--- a/sca-cpp/trunk/modules/js/htdocs/ui.js
+++ b/sca-cpp/trunk/modules/js/htdocs/ui.js
@@ -31,7 +31,7 @@ ui.elementByID = function(node, id) {
return null;
for (var i in node.childNodes) {
var child = node.childNodes[i];
- if (isNil(child))
+ if (isNull(child))
continue;
if (child.id == id)
return child;
@@ -275,7 +275,7 @@ ui.msieVersion = function() {
*/
ui.asyncFrame = null;
ui.async = function(f) {
- if (isNil(ui.asyncFrame))
+ if (isNull(ui.asyncFrame))
// Use requestAnimationFrame when available, fallback to setTimeout
ui.asyncFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
@@ -293,7 +293,7 @@ ui.delay = function(f, t) {
var id = window.setTimeout(function() {
delete ui.delayed[id];
return f();
- }, isNil(t)? 16 : t);
+ }, isNull(t)? 16 : t);
ui.delayed[id] = id;
return id;
};
@@ -311,12 +311,12 @@ ui.cancelDelay = function(id) {
*/
ui.animationFrame = null;
ui.animation = function(f) {
- if (isNil(ui.animationFrame))
+ if (isNull(ui.animationFrame))
// Use requestAnimationFrame when available, fallback to setInterval
ui.animationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
function(f) {
- if (!('interval' in f) || isNil(f.interval)) {
+ if (!('interval' in f) || isNull(f.interval)) {
// First call, setup the interval
f.interval = window.setInterval(function animation() {
f.clearInterval = true;
@@ -370,7 +370,7 @@ ui.onload = function() {
} else {
// Style scroll bars
var h = document.getElementsByTagName('html');
- if (!isNil(h))
+ if (!isNull(h))
h[0].className = h[0].className? h[0].classname + ' flatscrollbars' : 'flatscrollbars';
}
@@ -393,7 +393,7 @@ ui.onload = function() {
ui.onorientationchange = function(e) {
// Adjust filler height
- if (!isNil(ui.filler))
+ if (!isNull(ui.filler))
ui.filler.style.height = ui.pixpos(window.orientation == 0? screen.height : screen.width);
// Scroll to hide the address bar
@@ -524,7 +524,7 @@ ui.datatable = function(l) {
}
function rows(l, i) {
- if (isNil(l))
+ if (isNull(l))
return '';
var e = car(l);
@@ -564,7 +564,7 @@ ui.datatable = function(l) {
ui.datalist = function(l) {
function rows(l, i) {
- if (isNil(l))
+ if (isNull(l))
return '';
var e = car(l);
diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js
index 1cf086c60e..a8fec3994d 100644
--- a/sca-cpp/trunk/modules/js/htdocs/util.js
+++ b/sca-cpp/trunk/modules/js/htdocs/util.js
@@ -81,7 +81,7 @@ function range(a, b) {
return l;
}
-function isNil(v) {
+function isNull(v) {
return (v == null || typeof v == 'undefined' || (v.constructor == Array && v.length == 0));
}
@@ -98,7 +98,7 @@ function isList(v) {
}
function isTaggedList(v, t) {
- return (isList(v) && !isNil(v) && car(v) == t);
+ return (isList(v) && !isNull(v) && car(v) == t);
}
var emptylist = new Array();
@@ -120,7 +120,7 @@ function length(l) {
* Scheme-like associations.
*/
function assoc(k, l) {
- if (isNil(l))
+ if (isNull(l))
return emptylist;
var n = l.length;
for(var i = 0; i < n; i++) {
@@ -134,7 +134,7 @@ function assoc(k, l) {
* Map, filter and reduce functions.
*/
function map(f, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
var n = l.length;
var a = new Array();
@@ -145,7 +145,7 @@ function map(f, l) {
}
function filter(f, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
var n = l.length;
var a = new Array();
@@ -157,7 +157,7 @@ function filter(f, l) {
}
function reduce(f, i, l) {
- if (isNil(l))
+ if (isNull(l))
return i;
return reduce(f, f(i, car(l)), cdr(l));
}
@@ -223,7 +223,7 @@ function isIE() {
* External build configuration.
*/
var config;
-if (isNil(config))
+if (isNull(config))
config = {};
/**
@@ -245,7 +245,7 @@ function assert(exp) {
* Write a list of strings.
*/
function writeStrings(l) {
- if (isNil(l))
+ if (isNull(l))
return '';
var s = '';
var n = l.length;
@@ -268,14 +268,14 @@ function writeValue(v) {
}
function writeList(l) {
- if (isNil(l))
+ if (isNull(l))
return '';
return ' ' + writeValue(car(l)) + writeList(cdr(l));
}
if (!isList(v))
return writePrimitive(v);
- if (isNil(v))
+ if (isNull(v))
return '()';
return '(' + writeValue(car(v)) + writeList(cdr(v)) + ')';
}
@@ -403,7 +403,7 @@ function domainname(host) {
if (s != -1)
return domainname(host.substring(0, s));
var h = reverse(host.split('.'));
- var d = (!isNil(cddr(h)) && caddr(h) == 'www')? mklist(car(h), cadr(h), caddr(h)) : mklist(car(h), cadr(h));
+ var d = (!isNull(cddr(h)) && caddr(h) == 'www')? mklist(car(h), cadr(h), caddr(h)) : mklist(car(h), cadr(h));
return reverse(d).join('.');
}
@@ -536,7 +536,7 @@ function setcaddr(l, v) {
* Append the elements of a list to a list.
*/
function setappend(a, b) {
- if (isNil(b))
+ if (isNull(b))
return a;
a.push(car(b));
return setappend(a, cdr(b));
diff --git a/sca-cpp/trunk/modules/js/htdocs/xmlutil.js b/sca-cpp/trunk/modules/js/htdocs/xmlutil.js
index 4d943cce75..29240dff9c 100644
--- a/sca-cpp/trunk/modules/js/htdocs/xmlutil.js
+++ b/sca-cpp/trunk/modules/js/htdocs/xmlutil.js
@@ -26,7 +26,7 @@
*/
function nodeList(n) {
var l = new Array();
- if (isNil(n))
+ if (isNull(n))
return l;
for (var i = 0; i < n.length; i++)
l[i] = n[i];
@@ -37,7 +37,7 @@ function nodeList(n) {
* Append a list of nodes to a parent node.
*/
function appendNodes(nodes, p) {
- if (isNil(nodes))
+ if (isNull(nodes))
return p;
p.appendChild(car(nodes));
return appendNodes(cdr(nodes), p);
@@ -71,7 +71,7 @@ function childText(e) {
* Read a list of XML attributes.
*/
function readAttributes(p, a) {
- if (isNil(a))
+ if (isNull(a))
return a;
var x = car(a);
return cons(mklist(attribute, "'" + x.nodeName, x.nodeValue), readAttributes(p, cdr(a)));
@@ -83,7 +83,7 @@ function readAttributes(p, a) {
function readElement(e, childf) {
var l = append(append(mklist(element, "'" + e.nodeName), readAttributes(e, childf(e))), readElements(childElements(e), childf));
var t = childText(e);
- if (isNil(t))
+ if (isNull(t))
return l;
return append(l, mklist(car(t).nodeValue));
}
@@ -92,7 +92,7 @@ function readElement(e, childf) {
* Read a list of XML elements.
*/
function readElements(l, childf) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(readElement(car(l), childf), readElements(cdr(l), childf));
}
@@ -101,7 +101,7 @@ function readElements(l, childf) {
* Return true if a list of strings contains an XML document.
*/
function isXML(l) {
- if (isNil(l))
+ if (isNull(l))
return false;
return car(l).substring(0, 5) == '<?xml';
}
@@ -120,7 +120,7 @@ function parseXML(l) {
*/
function readXMLDocument(doc) {
var root = childElements(doc);
- if (isNil(root))
+ if (isNull(root))
return mklist();
return mklist(readElement(car(root), childAttributes));
}
@@ -133,7 +133,7 @@ function readXHTMLElement(xhtml) {
function ieChildAttributes(e) {
var a = filter(function(n) {
// Filter out empty and internal DOM attributes
- if (n.nodeType != 2 || isNil(n.nodeValue) || n.nodeValue == '')
+ if (n.nodeType != 2 || isNull(n.nodeValue) || n.nodeValue == '')
return false;
if (n.nodeName == 'contentEditable' || n.nodeName == 'maxLength' || n.nodeName == 'loop' || n.nodeName == 'start')
return false;
@@ -174,13 +174,13 @@ function writeXMLDocument(doc) {
* Write a list of XML element and attribute tokens.
*/
function expandElementValues(n, l) {
- if (isNil(l))
+ if (isNull(l))
return l;
return cons(cons(element, cons(n, car(l))), expandElementValues(n, cdr(l)));
}
function writeList(l, node, doc) {
- if (isNil(l))
+ if (isNull(l))
return node;
var token = car(l);
@@ -196,7 +196,7 @@ function writeList(l, node, doc) {
function mkelem(tok, doc) {
function xmlns(l) {
- if (isNil(l))
+ if (isNull(l))
return null;
var t = car(l);
if (isTaggedList(t, attribute)) {
diff --git a/sca-cpp/trunk/modules/json/json.hpp b/sca-cpp/trunk/modules/json/json.hpp
index 497624070b..caef19b835 100644
--- a/sca-cpp/trunk/modules/json/json.hpp
+++ b/sca-cpp/trunk/modules/json/json.hpp
@@ -58,13 +58,13 @@ public:
* Returns true if a list represents a JS array.
*/
inline const bool isJSArray(const list<value>& l) {
- if(isNil(l))
+ if(isNull(l))
return true;
const value v = car(l);
if (isSymbol(v))
return false;
if(isList(v)) {
- if(!isNil((list<value>)v) && isSymbol(car<value>(v)))
+ if(!isNull((list<value>)v) && isSymbol(car<value>(v)))
return false;
}
return true;
@@ -94,7 +94,7 @@ inline const list<value> jsPropertiesToValues(const list<value>& propertiesSoFar
const char* const name = json_object_iter_key(i);
json_t* const jsv = json_object_iter_value(i);
const value val = jsValToValue(jsv);
- if (isNil(val) && !isList(val))
+ if (isNull(val) && !isList(val))
return jsPropertiesToValues(cons<value> (mklist<value> (element, c_str(name), val), propertiesSoFar), o, json_object_iter_next(o, i));
if (substr(name, 0, 1) == atsign)
return jsPropertiesToValues(cons<value>(mklist<value>(attribute, c_str(substr(name, 1)), val), propertiesSoFar), o, json_object_iter_next(o, i));
@@ -148,7 +148,7 @@ const value jsValToValue(json_t* const jsv) {
*/
inline json_t* const valuesToJSElements(json_t* const a, const list<value>& l) {
json_t* const valueToJSVal(const value& val);
- if (isNil(l))
+ if (isNull(l))
return a;
json_t* const v = valueToJSVal(car(l));
json_array_append(a, v);
@@ -199,7 +199,7 @@ inline json_t* const valueToJSVal(const value& val) {
* Converts a list of values to JS properties.
*/
inline json_t* const valuesToJSProperties(json_t* const o, const list<value>& l) {
- if (isNil(l))
+ if (isNull(l))
return o;
// Write an attribute
@@ -235,7 +235,7 @@ inline json_t* const valuesToJSProperties(json_t* const o, const list<value>& l)
* Return true if a list of strings contains a JSON document.
*/
inline const bool isJSON(const list<string>& ls) {
- if (isNil(ls))
+ if (isNull(ls))
return false;
const string s = substr(car(ls), 0, 1);
return s == "[" || s == "{";
@@ -390,7 +390,7 @@ inline const string funcName(const string& f) {
* of key value pairs.
*/
inline const list<value> queryParams(const list<value>& a) {
- if (isNil(a))
+ if (isNull(a))
return nilListValue;
const list<value> p = car(a);
if (car(p) == value("id") || car(p) == value("method"))