removing dependency on types
This commit is contained in:
parent
cb99151753
commit
a080f6079c
|
@ -68,8 +68,6 @@
|
|||
baselib-exceptions.js
|
||||
baselib-readergraph.js
|
||||
|
||||
link.js
|
||||
types.js
|
||||
runtime.js))
|
||||
|
||||
|
||||
|
|
|
@ -153,6 +153,29 @@
|
|||
var makePair = Cons.makeInstance;
|
||||
|
||||
|
||||
var makeList = function() {
|
||||
var result = Empty.EMPTY;
|
||||
for(var i = arguments.length-1; i >= 0; i--) {
|
||||
result = Cons.makeInstance(arguments[i], result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
// isList: Any -> Boolean
|
||||
// Returns true if x is a list (a chain of pairs terminated by EMPTY).
|
||||
var isList = function(x) {
|
||||
while (x !== Empty.EMPTY) {
|
||||
if (x instanceof Cons){
|
||||
x = x.rest;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -160,8 +183,9 @@
|
|||
exports.Empty = Empty;
|
||||
exports.Cons = Cons;
|
||||
exports.isPair = isPair;
|
||||
exports.isList = isList;
|
||||
exports.makePair = makePair;
|
||||
|
||||
exports.makeList = makeList;
|
||||
|
||||
|
||||
})(this['plt'].baselib);
|
|
@ -6,7 +6,6 @@ if (! this['plt']) { this['plt'] = {}; }
|
|||
var link = {};
|
||||
scope['link'] = link;
|
||||
|
||||
|
||||
// link.ready: (string (string -> void)) -> void
|
||||
// When the name announces that it's ready, calls the function f.
|
||||
link.ready = function(name, f) {
|
||||
|
@ -27,7 +26,6 @@ if (! this['plt']) { this['plt'] = {}; }
|
|||
};
|
||||
|
||||
|
||||
|
||||
// notifyAll: string -> void
|
||||
// Tell all listeners that the name is ready.
|
||||
var notifyAll = function(name) {
|
||||
|
|
|
@ -27,18 +27,16 @@ if(this['plt'] === undefined) { this['plt'] = {}; }
|
|||
var isNumber = plt.baselib.numbers.isNumber;
|
||||
var isNatural = plt.baselib.numbers.isNatural;
|
||||
var isReal = plt.baselib.numbers.isReal;
|
||||
var isPair = types.isPair;
|
||||
var isList = types.isList;
|
||||
var isVector = types.isVector;
|
||||
var isString = types.isString;
|
||||
var equals = types.equals;
|
||||
var isPair = plt.baselib.lists.isPair;
|
||||
var isList = plt.baselib.lists.isList;
|
||||
var isVector = plt.baselib.vectors.isVector;
|
||||
var isString = plt.baselib.strings.isString;
|
||||
var equals = plt.baselib.equality.equals;
|
||||
|
||||
|
||||
var NULL = types.EMPTY;
|
||||
var NULL = plt.baselib.lists.EMPTY;
|
||||
var VOID = plt.baselib.constants.VOID_VALUE;
|
||||
var EOF = plt.baselib.constants.EOF_VALUE;
|
||||
|
||||
|
||||
var NEGATIVE_ZERO = plt.baselib.numbers.negative_zero;
|
||||
var INF = plt.baselib.numbers.inf;
|
||||
var NEGATIVE_INF = plt.baselib.numbers.negative_inf;
|
||||
|
@ -50,9 +48,9 @@ if(this['plt'] === undefined) { this['plt'] = {}; }
|
|||
var makeComplex = plt.baselib.numbers.makeComplex;
|
||||
|
||||
|
||||
var makeVector = types.vector;
|
||||
var makeList = types.list;
|
||||
var makePair = types.pair;
|
||||
var makeVector = plt.baselib.vectors.makeVector;
|
||||
var makeList = plt.baselib.lists.makeList;
|
||||
var makePair = plt.baselib.lists.makePair;
|
||||
|
||||
var heir = plt.baselib.heir;
|
||||
var toDomNode = plt.baselib.format.toDomNode;
|
||||
|
@ -2633,7 +2631,4 @@ if(this['plt'] === undefined) { this['plt'] = {}; }
|
|||
exports['StructType'] = plt.baselib.structs.StructType;
|
||||
|
||||
|
||||
scope.link.announceReady('runtime');
|
||||
|
||||
|
||||
})(this['plt']);
|
|
@ -1,4 +1,4 @@
|
|||
#lang s-exp "../../lang/base.rkt"
|
||||
#lang planet dyoo/whalesong
|
||||
(begin
|
||||
(define make-parser
|
||||
(lambda (grammar lexer)
|
||||
|
|
Loading…
Reference in New Issue
Block a user