squint-cljs 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +36 -36
- package/lib/compiler.js +220 -219
- package/lib/compiler.node.js +1148 -1148
- package/package.json +1 -1
- package/src/squint/core.js +38 -0
package/package.json
CHANGED
package/src/squint/core.js
CHANGED
|
@@ -1232,3 +1232,41 @@ export function reduce_kv(f, init, m) {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
return ret;
|
|
1234
1234
|
}
|
|
1235
|
+
|
|
1236
|
+
export function max(x, y, ...more) {
|
|
1237
|
+
if (y == undefined) {
|
|
1238
|
+
return x;
|
|
1239
|
+
}
|
|
1240
|
+
if ( more.length == 0) {
|
|
1241
|
+
return ( x > y ) ? x : y;
|
|
1242
|
+
}
|
|
1243
|
+
return max(max(x,y),...more);
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
export function min(x, y, ...more) {
|
|
1247
|
+
if (y == undefined) {
|
|
1248
|
+
return x;
|
|
1249
|
+
}
|
|
1250
|
+
if ( more.length == 0) {
|
|
1251
|
+
return ( x < y ) ? x : y;
|
|
1252
|
+
}
|
|
1253
|
+
return min(min(x,y),...more);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
export function map_QMARK_(x) {
|
|
1257
|
+
return (x instanceof Object);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
export function every_pred(...preds) {
|
|
1261
|
+
return (...args) => {
|
|
1262
|
+
for (let p of preds) {
|
|
1263
|
+
for (let a of args) {
|
|
1264
|
+
let res = p(a);
|
|
1265
|
+
if (!res) {
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
return true;
|
|
1271
|
+
};
|
|
1272
|
+
}
|