improving printout of functions

This commit is contained in:
Danny Yoo 2011-08-24 14:31:49 -04:00
parent 87eb04e440
commit f488db734b

View File

@ -66,6 +66,11 @@
if (typeof(x) === 'string') {
return escapeString(x.toString());
}
if (baselib.functions.isProcedure(x)) {
return '#<procedure:' + x.displayName + '>';
}
if (typeof(x) !== 'object' && typeof(x) !== 'function') {
return x.toString();
}
@ -105,6 +110,11 @@
if (typeof(x) === 'string') {
return x;
}
if (baselib.functions.isProcedure(x)) {
return '#<procedure:' + x.displayName + '>';
}
if (typeof(x) !== 'object' && typeof(x) !== 'function') {
return x.toString();
}
@ -373,10 +383,16 @@
return wrapper;
}
if (baselib.functions.isProcedure(x)) {
node = document.createElement("span");
node.appendChild(document.createTextNode('#<procedure: ' + x.displayName + '>'));
$(node).addClass("procedure");
return node;
}
if (typeof(x) !== 'object' && typeof(x) !== 'function') {
node = document.createElement("span");
node.appendChild(document.createTextNode(x.toString()));
$(node).addClass("procedure");
return node;
}