vendor/sequence.js in ruby-wisp-source-0.7.0 vs vendor/sequence.js in ruby-wisp-source-0.8.0
- old
+ new
@@ -1,18 +1,21 @@
-var _ns_ = "wisp.sequence";
-module.namespace = _ns_;
-var isNil = (require("./runtime")).isNil;
-var isVector = (require("./runtime")).isVector;
-var isFn = (require("./runtime")).isFn;
-var isNumber = (require("./runtime")).isNumber;
-var isString = (require("./runtime")).isString;
-var isDictionary = (require("./runtime")).isDictionary;
-var keyValues = (require("./runtime")).keyValues;
-var str = (require("./runtime")).str;
-var dec = (require("./runtime")).dec;
-var inc = (require("./runtime")).inc;
-var merge = (require("./runtime")).merge;;
+var _ns_ = {
+ "id": "wisp.sequence"
+};
+var wisp_runtime = require("./runtime");
+var isNil = wisp_runtime.isNil;
+var isVector = wisp_runtime.isVector;
+var isFn = wisp_runtime.isFn;
+var isNumber = wisp_runtime.isNumber;
+var isString = wisp_runtime.isString;
+var isDictionary = wisp_runtime.isDictionary;
+var keyValues = wisp_runtime.keyValues;
+var str = wisp_runtime.str;
+var dec = wisp_runtime.dec;
+var inc = wisp_runtime.inc;
+var merge = wisp_runtime.merge;
+var dictionary = wisp_runtime.dictionary;;;
var List = function List(head, tail) {
this.head = head;
this.tail = tail || (list());
this.length = inc(count(this.tail));
@@ -455,10 +458,16 @@
(function() { throw TypeError("" + "Type can't be conjoined " + sequence); })() :
void(0);
};
exports.conj = conj;
+var assoc = function assoc(source) {
+ var keyValues = Array.prototype.slice.call(arguments, 1);
+ return conj(source, dictionary.apply(dictionary, keyValues));
+};
+exports.assoc = assoc;
+
var concat = function concat() {
var sequences = Array.prototype.slice.call(arguments, 0);
return reverse(reduce(function(result, sequence) {
return reduce(function(result, item) {
return cons(item, result);
@@ -550,6 +559,6 @@
(n = dec(n), result = conj(result, x), loop);
};
return recur;
})(n, []);
};
-exports.repeat = repeat
+exports.repeat = repeat
\ No newline at end of file