moving isString into plt.baselib.strings

This commit is contained in:
Danny Yoo 2011-07-04 18:53:11 -04:00
parent e5312af2cd
commit 190b805b6c
3 changed files with 16 additions and 5 deletions

View File

@ -9,11 +9,11 @@
var equals = function(x, y, aUnionFind) {
if (x === y) { return true; }
if (isNumber(x) && isNumber(y)) {
if (jsnums.isSchemeNumber(x) && jsnums.isSchemeNumber(y)) {
return jsnums.eqv(x, y);
}
if (isString(x) && isString(y)) {
if (baselib.strings.isString(x) && baselib.strings.isString(y)) {
return x.toString() === y.toString();
}

View File

@ -10,6 +10,16 @@
baselib.strings = exports;
var isString = function(s) {
return (typeof s === 'string' ||
s instanceof Str);
};
// Now using mutable strings
var Str = function(chars) {
this.chars = chars;
@ -156,5 +166,7 @@ String.prototype.toDisplayedString = function(cache) {
exports.Str = Str;
exports.escapeString = escapeString;
exports.isString = isString;
})(this['plt'].baselib);

View File

@ -664,9 +664,8 @@ if (! this['plt']) { this['plt'] = {}; }
var isString = function(s) {
return (typeof s === 'string' || s instanceof plt.baselib.strings.Str);
}
var isString = plt.baselib.strings.isString;