@calcit/procs 0.6.7 → 0.6.8
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/calcit.procs.mjs +4 -7
- package/package.json +1 -1
- package/ts-src/calcit.procs.mts +4 -7
package/lib/calcit.procs.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
// CALCIT VERSION
|
|
3
|
-
export const calcit_version = "0.6.
|
|
3
|
+
export const calcit_version = "0.6.8";
|
|
4
4
|
import { parse } from "@cirru/parser.ts";
|
|
5
5
|
import { writeCirruCode } from "@cirru/writer.ts";
|
|
6
6
|
import "./js-primes.mjs";
|
|
@@ -359,23 +359,20 @@ export let remove_watch = (a, k) => {
|
|
|
359
359
|
a.listeners.delete(k);
|
|
360
360
|
return null;
|
|
361
361
|
};
|
|
362
|
-
export let range = (n, m,
|
|
362
|
+
export let range = (n, m, step = 1) => {
|
|
363
363
|
var result = new CalcitSliceList([]);
|
|
364
|
-
if (m2 != null) {
|
|
365
|
-
console.warn("TODO range with 3 arguments"); // TODO
|
|
366
|
-
}
|
|
367
364
|
if (m != null) {
|
|
368
365
|
var idx = n;
|
|
369
366
|
while (idx < m) {
|
|
370
367
|
result = result.append(idx);
|
|
371
|
-
idx = idx +
|
|
368
|
+
idx = idx + step;
|
|
372
369
|
}
|
|
373
370
|
}
|
|
374
371
|
else {
|
|
375
372
|
var idx = 0;
|
|
376
373
|
while (idx < n) {
|
|
377
374
|
result = result.append(idx);
|
|
378
|
-
idx = idx +
|
|
375
|
+
idx = idx + step;
|
|
379
376
|
}
|
|
380
377
|
}
|
|
381
378
|
return result;
|
package/package.json
CHANGED
package/ts-src/calcit.procs.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// CALCIT VERSION
|
|
2
|
-
export const calcit_version = "0.6.
|
|
2
|
+
export const calcit_version = "0.6.8";
|
|
3
3
|
|
|
4
4
|
import { parse, ICirruNode } from "@cirru/parser.ts";
|
|
5
5
|
import { writeCirruCode } from "@cirru/writer.ts";
|
|
@@ -418,22 +418,19 @@ export let remove_watch = (a: CalcitRef, k: CalcitKeyword): null => {
|
|
|
418
418
|
return null;
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
export let range = (n: number, m: number,
|
|
421
|
+
export let range = (n: number, m: number, step: number = 1): CalcitSliceList | CalcitList => {
|
|
422
422
|
var result: CalcitList | CalcitSliceList = new CalcitSliceList([]);
|
|
423
|
-
if (m2 != null) {
|
|
424
|
-
console.warn("TODO range with 3 arguments"); // TODO
|
|
425
|
-
}
|
|
426
423
|
if (m != null) {
|
|
427
424
|
var idx = n;
|
|
428
425
|
while (idx < m) {
|
|
429
426
|
result = result.append(idx);
|
|
430
|
-
idx = idx +
|
|
427
|
+
idx = idx + step;
|
|
431
428
|
}
|
|
432
429
|
} else {
|
|
433
430
|
var idx = 0;
|
|
434
431
|
while (idx < n) {
|
|
435
432
|
result = result.append(idx);
|
|
436
|
-
idx = idx +
|
|
433
|
+
idx = idx + step;
|
|
437
434
|
}
|
|
438
435
|
}
|
|
439
436
|
return result;
|