remove Ox.merge

This commit is contained in:
rolux 2012-05-24 12:19:47 +02:00
parent f6b06d0975
commit 64c01e385d

View file

@ -365,31 +365,6 @@ Ox.indexOf = function(arr) {
};
*/
/*@
Ox.merge <f> Merges an array with one or more other arrays
For convenience, literals are treated as arrays with one element
(arr, arr[, arr[, ...]]) -> <a> Array
> Ox.merge([1], [2, 3, 2], [1])
[1, 2, 3, 2, 1]
> Ox.merge(1, [2, 3, 2], 1)
[1, 2, 3, 2, 1]
@*/
// FIXME: [].concat exists!
Ox.merge = function(arr) {
arr = Ox.makeArray(arr);
Ox.slice(arguments, 1).forEach(function(arg) {
arg = Ox.makeArray(arg);
if (arg.length < Ox.STACK_SIZE) {
arr.push.apply(arr, arg);
} else {
arg.forEach(function(val) {
arr.push(val);
});
}
});
return arr;
};
/*@
Ox.range <f> Python-style range
(stop) -> <[n]> range