trying to dissolve the circular link between types and helpers

This commit is contained in:
Danny Yoo 2011-07-04 18:07:41 -04:00
parent d64431bd64
commit b1be04269b
3 changed files with 27 additions and 33 deletions

View File

@ -8,7 +8,8 @@
// format: string [X ...] string -> string // format: string [X ...] string -> string
// String formatting. // String formatting. If an exception occurs, throws
// a plain Error whose message describes the formatting error.
var format = function(formatStr, args, functionName) { var format = function(formatStr, args, functionName) {
var throwFormatError = function() { var throwFormatError = function() {
functionName = functionName || 'format'; functionName = functionName || 'format';

View File

@ -279,26 +279,26 @@ if (! this['plt']) { this['plt'] = {}; }
} }
var wrapJsValue = function(x) { // var wrapJsValue = function(x) {
if (x === undefined) { // if (x === undefined) {
return types.jsValue('undefined', x); // return types.jsValue('undefined', x);
} // }
else if (x === null) { // else if (x === null) {
return types.jsValue('null', x); // return types.jsValue('null', x);
} // }
else if (typeof(x) == 'function') { // else if (typeof(x) == 'function') {
return types.jsValue('function', x); // return types.jsValue('function', x);
} // }
else if ( x instanceof Array ) { // else if ( x instanceof Array ) {
return types.jsValue('array', x); // return types.jsValue('array', x);
} // }
else if ( typeof(x) == 'string' ) { // else if ( typeof(x) == 'string' ) {
return types.jsValue("'" + x.toString() + "'", x); // return types.jsValue("'" + x.toString() + "'", x);
} // }
else { // else {
return types.jsValue(x.toString(), x); // return types.jsValue(x.toString(), x);
} // }
}; // };
var getKeyCodeName = function(e) { var getKeyCodeName = function(e) {
@ -490,7 +490,7 @@ if (! this['plt']) { this['plt'] = {}; }
helpers.flattenSchemeListToArray = flattenSchemeListToArray; helpers.flattenSchemeListToArray = flattenSchemeListToArray;
helpers.ordinalize = ordinalize; helpers.ordinalize = ordinalize;
helpers.wrapJsValue = wrapJsValue; // helpers.wrapJsValue = wrapJsValue;
helpers.getKeyCodeName = getKeyCodeName; helpers.getKeyCodeName = getKeyCodeName;

View File

@ -21,22 +21,15 @@ if (! this['plt']) { this['plt'] = {}; }
var helpers = scope['helpers']; var helpers = scope['helpers'];
var getEqHashCode = helpers.getEqHashCode, var getEqHashCode = plt.baselib.hash.getEqHashCode;
// makeLowLevelEqHash: -> hashtable // makeLowLevelEqHash: -> hashtable
// Constructs an eq hashtable that uses Moby's getEqHashCode function. // Constructs an eq hashtable that uses Moby's getEqHashCode function.
var makeLowLevelEqHash = plt.baselib.hash.makeLowLevelEqHash;
makeLowLevelEqHash = helpers.makeLowLevelEqHash;
var toWrittenString = plt.baselib.format.toWrittenString; var toWrittenString = plt.baselib.format.toWrittenString;
var toDisplayedString = plt.baselib.format.toDisplayedString; var toDisplayedString = plt.baselib.format.toDisplayedString;
var toDomNode = plt.baselib.format.toDomNode; var toDomNode = plt.baselib.format.toDomNode;
scope.link.ready('helpers', function() {
helpers = scope['helpers'];
getEqHashCode = helpers.getEqHashCode;
makeLowLevelEqHash = helpers.makeLowLevelEqHash;
});
var appendChild = function(parent, child) { var appendChild = function(parent, child) {