@calcit/procs 0.5.0-a6 → 0.5.0

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.
@@ -1,7 +1,7 @@
1
1
  var _a;
2
2
  // CALCIT VERSION
3
- export const calcit_version = "0.5.0-a6";
4
- import { initTernaryTreeMap } from "@calcit/ternary-tree";
3
+ export const calcit_version = "0.5.0";
4
+ import "@calcit/ternary-tree";
5
5
  import { parse } from "@cirru/parser.ts";
6
6
  import { writeCirruCode } from "@cirru/writer.ts";
7
7
  import "./js-primes";
@@ -16,8 +16,8 @@ export * from "./js-primes";
16
16
  export * from "./js-tuple";
17
17
  export * from "./custom-formatter";
18
18
  export * from "./js-cirru";
19
- import { CalcitList, foldl } from "./js-list";
20
- import { CalcitMap } from "./js-map";
19
+ import { CalcitList, CalcitSliceList, foldl } from "./js-list";
20
+ import { CalcitMap, CalcitSliceMap } from "./js-map";
21
21
  import { CalcitSet } from "./js-set";
22
22
  import { CalcitTuple } from "./js-tuple";
23
23
  import { to_calcit_data, extract_cirru_edn } from "./js-cirru";
@@ -32,10 +32,10 @@ export let type_of = (x) => {
32
32
  if (x instanceof CalcitKeyword) {
33
33
  return kwd("keyword");
34
34
  }
35
- if (x instanceof CalcitList) {
35
+ if (x instanceof CalcitList || x instanceof CalcitSliceList) {
36
36
  return kwd("list");
37
37
  }
38
- if (x instanceof CalcitMap) {
38
+ if (x instanceof CalcitMap || x instanceof CalcitSliceMap) {
39
39
  return kwd("map");
40
40
  }
41
41
  if (x == null) {
@@ -76,7 +76,7 @@ export let print = (...xs) => {
76
76
  console.log(xs.map((x) => toString(x, false)).join(" "));
77
77
  };
78
78
  export function _$n_list_$o_count(x) {
79
- if (x instanceof CalcitList)
79
+ if (x instanceof CalcitList || x instanceof CalcitSliceList)
80
80
  return x.len();
81
81
  throw new Error(`expected a list ${x}`);
82
82
  }
@@ -86,7 +86,7 @@ export function _$n_str_$o_count(x) {
86
86
  throw new Error(`expected a string ${x}`);
87
87
  }
88
88
  export function _$n_map_$o_count(x) {
89
- if (x instanceof CalcitMap)
89
+ if (x instanceof CalcitMap || x instanceof CalcitSliceMap)
90
90
  return x.len();
91
91
  throw new Error(`expected a map ${x}`);
92
92
  }
@@ -101,17 +101,17 @@ export function _$n_set_$o_count(x) {
101
101
  throw new Error(`expected a set ${x}`);
102
102
  }
103
103
  export let _$L_ = (...xs) => {
104
- return new CalcitList(xs);
104
+ return new CalcitSliceList(xs);
105
105
  };
106
106
  // single quote as alias for list
107
107
  export let _SQUO_ = (...xs) => {
108
- return new CalcitList(xs);
108
+ return new CalcitSliceList(xs);
109
109
  };
110
110
  export let _$n__$M_ = (...xs) => {
111
111
  if (xs.length % 2 !== 0) {
112
112
  throw new Error("&map expects even number of arguments");
113
113
  }
114
- return new CalcitMap(xs);
114
+ return new CalcitSliceMap(xs);
115
115
  };
116
116
  export let defatom = (path, x) => {
117
117
  let v = new CalcitRef(x, path);
@@ -151,7 +151,7 @@ export let _$n_str_$o_contains_$q_ = (xs, x) => {
151
151
  throw new Error("string `contains?` expected a string");
152
152
  };
153
153
  export let _$n_list_$o_contains_$q_ = (xs, x) => {
154
- if (xs instanceof CalcitList) {
154
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
155
155
  if (typeof x != "number") {
156
156
  throw new Error("Expected number index for detecting");
157
157
  }
@@ -164,7 +164,7 @@ export let _$n_list_$o_contains_$q_ = (xs, x) => {
164
164
  throw new Error("list `contains?` expected a list");
165
165
  };
166
166
  export let _$n_map_$o_contains_$q_ = (xs, x) => {
167
- if (xs instanceof CalcitMap)
167
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap)
168
168
  return xs.contains(x);
169
169
  throw new Error("map `contains?` expected a map");
170
170
  };
@@ -183,7 +183,7 @@ export let _$n_str_$o_includes_$q_ = (xs, x) => {
183
183
  throw new Error("string includes? expected a string");
184
184
  };
185
185
  export let _$n_list_$o_includes_$q_ = (xs, x) => {
186
- if (xs instanceof CalcitList) {
186
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
187
187
  let size = xs.len();
188
188
  for (let v of xs.items()) {
189
189
  if (_$n__$e_(v, x)) {
@@ -195,7 +195,7 @@ export let _$n_list_$o_includes_$q_ = (xs, x) => {
195
195
  throw new Error("list includes? expected a list");
196
196
  };
197
197
  export let _$n_map_$o_includes_$q_ = (xs, x) => {
198
- if (xs instanceof CalcitMap) {
198
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap) {
199
199
  for (let [k, v] of xs.pairs()) {
200
200
  if (_$n__$e_(v, x)) {
201
201
  return true;
@@ -225,7 +225,7 @@ export let _$n_list_$o_nth = function (xs, k) {
225
225
  throw new Error("nth takes 2 arguments");
226
226
  if (typeof k !== "number")
227
227
  throw new Error("Expected number index for a list");
228
- if (xs instanceof CalcitList)
228
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList)
229
229
  return xs.get(k);
230
230
  throw new Error("Does not support `nth` on this type");
231
231
  };
@@ -249,7 +249,7 @@ export let _$n_record_$o_get = function (xs, k) {
249
249
  export let _$n_list_$o_assoc = function (xs, k, v) {
250
250
  if (arguments.length !== 3)
251
251
  throw new Error("assoc takes 3 arguments");
252
- if (xs instanceof CalcitList) {
252
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
253
253
  if (typeof k !== "number") {
254
254
  throw new Error("Expected number index for lists");
255
255
  }
@@ -273,7 +273,7 @@ export let _$n_map_$o_assoc = function (xs, ...args) {
273
273
  throw new Error("assoc takes at least 3 arguments");
274
274
  if (args.length % 2 !== 0)
275
275
  throw new Error("assoc expected odd arguments");
276
- if (xs instanceof CalcitMap)
276
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap)
277
277
  return xs.assoc(...args);
278
278
  throw new Error("map `assoc` expected a map");
279
279
  };
@@ -288,7 +288,7 @@ export let _$n_list_$o_assoc_before = function (xs, k, v) {
288
288
  if (arguments.length !== 3) {
289
289
  throw new Error("assoc takes 3 arguments");
290
290
  }
291
- if (xs instanceof CalcitList) {
291
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
292
292
  if (typeof k !== "number") {
293
293
  throw new Error("Expected number index for lists");
294
294
  }
@@ -300,7 +300,7 @@ export let _$n_list_$o_assoc_after = function (xs, k, v) {
300
300
  if (arguments.length !== 3) {
301
301
  throw new Error("assoc takes 3 arguments");
302
302
  }
303
- if (xs instanceof CalcitList) {
303
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
304
304
  if (typeof k !== "number") {
305
305
  throw new Error("Expected number index for lists");
306
306
  }
@@ -311,7 +311,7 @@ export let _$n_list_$o_assoc_after = function (xs, k, v) {
311
311
  export let _$n_list_$o_dissoc = function (xs, k) {
312
312
  if (arguments.length !== 2)
313
313
  throw new Error("dissoc takes 2 arguments");
314
- if (xs instanceof CalcitList) {
314
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
315
315
  if (typeof k !== "number")
316
316
  throw new Error("Expected number index for lists");
317
317
  return xs.dissoc(k);
@@ -321,7 +321,7 @@ export let _$n_list_$o_dissoc = function (xs, k) {
321
321
  export let _$n_map_$o_dissoc = function (xs, ...args) {
322
322
  if (args.length < 1)
323
323
  throw new Error("dissoc takes at least 2 arguments");
324
- if (xs instanceof CalcitMap) {
324
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap) {
325
325
  return xs.dissoc(...args);
326
326
  }
327
327
  throw new Error("`dissoc` expected a map");
@@ -355,7 +355,7 @@ export let remove_watch = (a, k) => {
355
355
  return null;
356
356
  };
357
357
  export let range = (n, m, m2) => {
358
- var result = new CalcitList([]);
358
+ var result = new CalcitSliceList([]);
359
359
  if (m2 != null) {
360
360
  console.warn("TODO range with 3 arguments"); // TODO
361
361
  }
@@ -376,17 +376,17 @@ export let range = (n, m, m2) => {
376
376
  return result;
377
377
  };
378
378
  export function _$n_list_$o_empty_$q_(xs) {
379
- if (xs instanceof CalcitList)
379
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList)
380
380
  return xs.isEmpty();
381
381
  throw new Error(`expected a list ${xs}`);
382
382
  }
383
383
  export function _$n_str_$o_empty_$q_(xs) {
384
- if (typeof xs == "string")
385
- return xs.length == 0;
384
+ if (typeof xs === "string")
385
+ return xs.length === 0;
386
386
  throw new Error(`expected a string ${xs}`);
387
387
  }
388
388
  export function _$n_map_$o_empty_$q_(xs) {
389
- if (xs instanceof CalcitMap)
389
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap)
390
390
  return xs.isEmpty();
391
391
  throw new Error(`expected a list ${xs}`);
392
392
  }
@@ -396,7 +396,7 @@ export function _$n_set_$o_empty_$q_(xs) {
396
396
  throw new Error(`expected a list ${xs}`);
397
397
  }
398
398
  export let _$n_list_$o_first = (xs) => {
399
- if (xs instanceof CalcitList) {
399
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
400
400
  if (xs.isEmpty()) {
401
401
  return null;
402
402
  }
@@ -413,11 +413,11 @@ export let _$n_str_$o_first = (xs) => {
413
413
  throw new Error("Expected a string");
414
414
  };
415
415
  export let _$n_map_$o_first = (xs) => {
416
- if (xs instanceof CalcitMap) {
416
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap) {
417
417
  // TODO order may not be stable enough
418
418
  let ys = xs.pairs();
419
419
  if (ys.length > 0) {
420
- return new CalcitList(ys[0]);
420
+ return new CalcitSliceList(ys[0]);
421
421
  }
422
422
  else {
423
423
  return null;
@@ -444,7 +444,7 @@ export let timeout_call = (duration, f) => {
444
444
  return null;
445
445
  };
446
446
  export let _$n_list_$o_rest = (xs) => {
447
- if (xs instanceof CalcitList) {
447
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
448
448
  if (xs.len() === 0) {
449
449
  return null;
450
450
  }
@@ -466,13 +466,13 @@ export let _$n_set_$o_rest = (xs) => {
466
466
  throw new Error("Expect a set");
467
467
  };
468
468
  export let _$n_map_$o_rest = (xs) => {
469
- if (xs instanceof CalcitMap) {
469
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap) {
470
470
  if (xs.len() > 0) {
471
471
  let k0 = xs.pairs()[0][0];
472
472
  return xs.dissoc(k0);
473
473
  }
474
474
  else {
475
- return new CalcitMap(initTernaryTreeMap([]));
475
+ return new CalcitSliceMap([]);
476
476
  }
477
477
  }
478
478
  console.error(xs);
@@ -488,19 +488,19 @@ export let not = (x) => {
488
488
  return !x;
489
489
  };
490
490
  export let prepend = (xs, v) => {
491
- if (!(xs instanceof CalcitList)) {
491
+ if (!(xs instanceof CalcitList || xs instanceof CalcitSliceList)) {
492
492
  throw new Error("Expected array");
493
493
  }
494
494
  return xs.prepend(v);
495
495
  };
496
496
  export let append = (xs, v) => {
497
- if (!(xs instanceof CalcitList)) {
497
+ if (!(xs instanceof CalcitList || xs instanceof CalcitSliceList)) {
498
498
  throw new Error("Expected array");
499
499
  }
500
500
  return xs.append(v);
501
501
  };
502
502
  export let last = (xs) => {
503
- if (xs instanceof CalcitList) {
503
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
504
504
  if (xs.isEmpty()) {
505
505
  return null;
506
506
  }
@@ -513,7 +513,7 @@ export let last = (xs) => {
513
513
  throw new Error("Data not ready for last");
514
514
  };
515
515
  export let butlast = (xs) => {
516
- if (xs instanceof CalcitList) {
516
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
517
517
  if (xs.len() === 0) {
518
518
  return null;
519
519
  }
@@ -555,7 +555,7 @@ export let _$n_list_$o_slice = (xs, from, to) => {
555
555
  to = size;
556
556
  }
557
557
  else if (to <= from) {
558
- return new CalcitList([]);
558
+ return new CalcitSliceList([]);
559
559
  }
560
560
  else if (to > size) {
561
561
  to = size;
@@ -563,12 +563,12 @@ export let _$n_list_$o_slice = (xs, from, to) => {
563
563
  return xs.slice(from, to);
564
564
  };
565
565
  export let _$n_list_$o_concat = (...lists) => {
566
- let result = new CalcitList([]);
566
+ let result = new CalcitSliceList([]);
567
567
  for (let item of lists) {
568
568
  if (item == null) {
569
569
  continue;
570
570
  }
571
- if (item instanceof CalcitList) {
571
+ if (item instanceof CalcitList || item instanceof CalcitSliceList) {
572
572
  if (result.isEmpty()) {
573
573
  result = item;
574
574
  }
@@ -608,7 +608,7 @@ export let _$n_number_$o_rem = (a, b) => {
608
608
  return a % b;
609
609
  };
610
610
  export let round_$q_ = (a) => {
611
- return a == Math.round(a);
611
+ return a === Math.round(a);
612
612
  };
613
613
  export let _$n_str_$o_concat = (a, b) => {
614
614
  let buffer = "";
@@ -624,9 +624,9 @@ export let sort = (xs, f) => {
624
624
  if (xs == null) {
625
625
  return null;
626
626
  }
627
- if (xs instanceof CalcitList) {
627
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
628
628
  let ys = xs.toArray();
629
- return new CalcitList(ys.sort(f));
629
+ return new CalcitSliceList(ys.sort(f));
630
630
  }
631
631
  throw new Error("Expected list");
632
632
  };
@@ -640,8 +640,8 @@ export let _$n_merge = (a, b) => {
640
640
  if (b == null) {
641
641
  return a;
642
642
  }
643
- if (a instanceof CalcitMap) {
644
- if (b instanceof CalcitMap) {
643
+ if (a instanceof CalcitMap || a instanceof CalcitSliceMap) {
644
+ if (b instanceof CalcitMap || b instanceof CalcitSliceMap) {
645
645
  return a.merge(b);
646
646
  }
647
647
  else {
@@ -649,7 +649,7 @@ export let _$n_merge = (a, b) => {
649
649
  }
650
650
  }
651
651
  if (a instanceof CalcitRecord) {
652
- if (b instanceof CalcitMap) {
652
+ if (b instanceof CalcitMap || b instanceof CalcitSliceMap) {
653
653
  let values = [];
654
654
  for (let item of a.values) {
655
655
  values.push(item);
@@ -682,26 +682,26 @@ export let _$n_merge_non_nil = (a, b) => {
682
682
  if (b == null) {
683
683
  return a;
684
684
  }
685
- if (!(a instanceof CalcitMap)) {
685
+ if (!(a instanceof CalcitMap || a instanceof CalcitSliceMap)) {
686
686
  throw new Error("Expected map");
687
687
  }
688
- if (!(b instanceof CalcitMap)) {
688
+ if (!(b instanceof CalcitMap || b instanceof CalcitSliceMap)) {
689
689
  throw new Error("Expected map");
690
690
  }
691
691
  return a.mergeSkip(b, null);
692
692
  };
693
693
  export let to_pairs = (xs) => {
694
- if (xs instanceof CalcitMap) {
694
+ if (xs instanceof CalcitMap || xs instanceof CalcitSliceMap) {
695
695
  let result = [];
696
696
  for (let [k, v] of xs.pairs()) {
697
- result.push(new CalcitList([k, v]));
697
+ result.push(new CalcitSliceList([k, v]));
698
698
  }
699
699
  return new CalcitSet(result);
700
700
  }
701
701
  else if (xs instanceof CalcitRecord) {
702
702
  let arr_result = [];
703
703
  for (let idx = 0; idx < xs.fields.length; idx++) {
704
- arr_result.push(new CalcitList([xs.fields[idx], xs.values[idx]]));
704
+ arr_result.push(new CalcitSliceList([xs.fields[idx], xs.values[idx]]));
705
705
  }
706
706
  return new CalcitSet(arr_result);
707
707
  }
@@ -785,10 +785,10 @@ export let _$n_str_$o_replace = (x, y, z) => {
785
785
  return result;
786
786
  };
787
787
  export let split = (xs, x) => {
788
- return new CalcitList(xs.split(x));
788
+ return new CalcitSliceList(xs.split(x));
789
789
  };
790
790
  export let split_lines = (xs) => {
791
- return new CalcitList(xs.split("\n"));
791
+ return new CalcitSliceList(xs.split("\n"));
792
792
  };
793
793
  export let _$n_str_$o_slice = (xs, m, n) => {
794
794
  if (n <= m) {
@@ -811,13 +811,13 @@ export let trim = (x, c) => {
811
811
  var buffer = x;
812
812
  var size = buffer.length;
813
813
  var idx = 0;
814
- while (idx < size && buffer[idx] == c) {
814
+ while (idx < size && buffer[idx] === c) {
815
815
  idx = idx + 1;
816
816
  }
817
817
  buffer = buffer.substring(idx);
818
818
  var size = buffer.length;
819
819
  var idx = size;
820
- while (idx > 1 && buffer[idx - 1] == c) {
820
+ while (idx > 1 && buffer[idx - 1] === c) {
821
821
  idx = idx - 1;
822
822
  }
823
823
  buffer = buffer.substring(0, idx);
@@ -840,7 +840,7 @@ export let char_from_code = (n) => {
840
840
  return String.fromCharCode(n);
841
841
  };
842
842
  export let _$n_set_$o_to_list = (x) => {
843
- return new CalcitList(x.values());
843
+ return new CalcitSliceList(x.values());
844
844
  };
845
845
  export let aget = (x, name) => {
846
846
  return x[name];
@@ -964,13 +964,13 @@ export let _$n_str_$o_compare = (x, y) => {
964
964
  return 0;
965
965
  };
966
966
  export let arrayToList = (xs) => {
967
- return new CalcitList(xs !== null && xs !== void 0 ? xs : []);
967
+ return new CalcitSliceList(xs !== null && xs !== void 0 ? xs : []);
968
968
  };
969
969
  export let listToArray = (xs) => {
970
970
  if (xs == null) {
971
971
  return null;
972
972
  }
973
- if (xs instanceof CalcitList) {
973
+ if (xs instanceof CalcitList || xs instanceof CalcitSliceList) {
974
974
  return xs.toArray();
975
975
  }
976
976
  else {
@@ -993,10 +993,10 @@ export let keyword_$q_ = (x) => {
993
993
  return x instanceof CalcitKeyword;
994
994
  };
995
995
  export let map_$q_ = (x) => {
996
- return x instanceof CalcitMap;
996
+ return x instanceof CalcitSliceMap || x instanceof CalcitMap;
997
997
  };
998
998
  export let list_$q_ = (x) => {
999
- return x instanceof CalcitList;
999
+ return x instanceof CalcitSliceList || x instanceof CalcitList;
1000
1000
  };
1001
1001
  export let set_$q_ = (x) => {
1002
1002
  return x instanceof CalcitSet;
@@ -1013,6 +1013,10 @@ export let record_$q_ = (x) => {
1013
1013
  export let tuple_$q_ = (x) => {
1014
1014
  return x instanceof CalcitTuple;
1015
1015
  };
1016
+ export let buffer_$q_ = (x) => {
1017
+ console.warn("TODO, detecting buffer");
1018
+ return false;
1019
+ };
1016
1020
  export let _$n_str_$o_escape = (x) => JSON.stringify(x);
1017
1021
  export let read_file = (path) => {
1018
1022
  var _a;
@@ -1048,7 +1052,7 @@ export let format_to_lisp = (x) => {
1048
1052
  else if (x instanceof CalcitSymbol) {
1049
1053
  return x.value;
1050
1054
  }
1051
- else if (x instanceof CalcitList) {
1055
+ else if (x instanceof CalcitList || x instanceof CalcitSliceList) {
1052
1056
  let chunk = "(";
1053
1057
  for (let item of x.items()) {
1054
1058
  if (chunk != "(") {
@@ -1078,7 +1082,7 @@ export let transform_code_to_cirru = (x) => {
1078
1082
  else if (x instanceof CalcitSymbol) {
1079
1083
  return x.value;
1080
1084
  }
1081
- else if (x instanceof CalcitList) {
1085
+ else if (x instanceof CalcitList || x instanceof CalcitSliceList) {
1082
1086
  let xs = [];
1083
1087
  for (let item of x.items()) {
1084
1088
  xs.push(transform_code_to_cirru(item));
@@ -1162,13 +1166,13 @@ export function invoke_method(p) {
1162
1166
  else if (obj instanceof CalcitSet) {
1163
1167
  klass = calcit_builtin_classes.set;
1164
1168
  }
1165
- else if (obj instanceof CalcitList) {
1169
+ else if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
1166
1170
  klass = calcit_builtin_classes.list;
1167
1171
  }
1168
1172
  else if (obj instanceof CalcitRecord) {
1169
1173
  klass = calcit_builtin_classes.record;
1170
1174
  }
1171
- else if (obj instanceof CalcitMap) {
1175
+ else if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
1172
1176
  klass = calcit_builtin_classes.map;
1173
1177
  }
1174
1178
  else {
@@ -1191,12 +1195,12 @@ export function invoke_method(p) {
1191
1195
  };
1192
1196
  }
1193
1197
  export let _$n_map_$o_to_list = (m) => {
1194
- if (m instanceof CalcitMap) {
1198
+ if (m instanceof CalcitMap || m instanceof CalcitSliceMap) {
1195
1199
  let ys = [];
1196
1200
  for (let pair of m.pairs()) {
1197
- ys.push(new CalcitList(pair));
1201
+ ys.push(new CalcitSliceList(pair));
1198
1202
  }
1199
- return new CalcitList(ys);
1203
+ return new CalcitSliceList(ys);
1200
1204
  }
1201
1205
  else {
1202
1206
  throw new Error("&map:to-list expected a Map");
@@ -1240,11 +1244,11 @@ let typeAsInt = (x) => {
1240
1244
  return PseudoTypeIndex.tuple;
1241
1245
  if (x instanceof CalcitRecur)
1242
1246
  return PseudoTypeIndex.recur;
1243
- if (x instanceof CalcitList)
1247
+ if (x instanceof CalcitList || x instanceof CalcitSliceList)
1244
1248
  return PseudoTypeIndex.list;
1245
1249
  if (x instanceof CalcitSet)
1246
1250
  return PseudoTypeIndex.set;
1247
- if (x instanceof CalcitMap)
1251
+ if (x instanceof CalcitMap || x instanceof CalcitSliceMap)
1248
1252
  return PseudoTypeIndex.map;
1249
1253
  if (x instanceof CalcitRecord)
1250
1254
  return PseudoTypeIndex.record;
@@ -1303,7 +1307,7 @@ export let _$n_compare = (a, b) => {
1303
1307
  }
1304
1308
  };
1305
1309
  export let _$n_map_$o_diff_new = (a, b) => {
1306
- if (a instanceof CalcitMap && b instanceof CalcitMap) {
1310
+ if ((a instanceof CalcitMap || a instanceof CalcitSliceMap) && (b instanceof CalcitMap || b instanceof CalcitSliceMap)) {
1307
1311
  return a.diffNew(b);
1308
1312
  }
1309
1313
  else {
@@ -1311,7 +1315,7 @@ export let _$n_map_$o_diff_new = (a, b) => {
1311
1315
  }
1312
1316
  };
1313
1317
  export let _$n_map_$o_diff_keys = (a, b) => {
1314
- if (a instanceof CalcitMap && b instanceof CalcitMap) {
1318
+ if ((a instanceof CalcitMap || a instanceof CalcitSliceMap) && (b instanceof CalcitMap || b instanceof CalcitSliceMap)) {
1315
1319
  return a.diffKeys(b);
1316
1320
  }
1317
1321
  else {
@@ -1319,7 +1323,7 @@ export let _$n_map_$o_diff_keys = (a, b) => {
1319
1323
  }
1320
1324
  };
1321
1325
  export let _$n_map_$o_common_keys = (a, b) => {
1322
- if (a instanceof CalcitMap && b instanceof CalcitMap) {
1326
+ if ((a instanceof CalcitMap || a instanceof CalcitSliceMap) && (b instanceof CalcitMap || b instanceof CalcitSliceMap)) {
1323
1327
  return a.commonKeys(b);
1324
1328
  }
1325
1329
  else {
@@ -1351,7 +1355,7 @@ export let _$n_list_$o_distinct = (xs) => {
1351
1355
  }
1352
1356
  result.push(data[idx]);
1353
1357
  }
1354
- return new CalcitList(result);
1358
+ return new CalcitSliceList(result);
1355
1359
  };
1356
1360
  export let _$n_get_os = () => {
1357
1361
  return kwd("js-engine");
@@ -1363,9 +1367,6 @@ let unavailableProc = (...xs) => {
1363
1367
  };
1364
1368
  // not available for calcit-js
1365
1369
  export let _$n_reset_gensym_index_$x_ = unavailableProc;
1366
- export let dbt__GT_point = unavailableProc;
1367
- export let dbt_digits = unavailableProc;
1368
- export let dual_balanced_ternary = unavailableProc;
1369
1370
  export let gensym = unavailableProc;
1370
1371
  export let macroexpand = unavailableProc;
1371
1372
  export let macroexpand_all = unavailableProc;
@@ -1,9 +1,9 @@
1
1
  import "./js-primes";
2
2
  import { CalcitRef, CalcitSymbol, CalcitKeyword } from "./calcit-data";
3
- import { toPairs } from "@calcit/ternary-tree";
3
+ import "@calcit/ternary-tree";
4
4
  import { CalcitRecord } from "./js-record";
5
- import { CalcitMap } from "./js-map";
6
- import { CalcitList } from "./js-list";
5
+ import { CalcitMap, CalcitSliceMap } from "./js-map";
6
+ import { CalcitList, CalcitSliceList } from "./js-list";
7
7
  import { CalcitSet } from "./js-set";
8
8
  import { CalcitTuple } from "./js-tuple";
9
9
  let embedObject = (x) => {
@@ -28,7 +28,7 @@ export let load_console_formatter_$x_ = () => {
28
28
  if (obj instanceof CalcitSymbol) {
29
29
  return ["div", { style: "color: hsl(340, 80%, 60%)" }, obj.toString()];
30
30
  }
31
- if (obj instanceof CalcitList) {
31
+ if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
32
32
  return [
33
33
  "div",
34
34
  { style: "color: hsl(280, 80%, 60%, 0.4)" },
@@ -36,7 +36,7 @@ export let load_console_formatter_$x_ = () => {
36
36
  ["span", { style: "font-size: 80%; vertical-align: 0.7em; color: hsl(280, 80%, 60%, 0.8)" }, `${obj.len()}`],
37
37
  ];
38
38
  }
39
- if (obj instanceof CalcitMap) {
39
+ if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
40
40
  return ["div", { style: "color: hsl(280, 80%, 60%, 0.4)" }, obj.toString(true)];
41
41
  }
42
42
  if (obj instanceof CalcitSet) {
@@ -65,10 +65,10 @@ export let load_console_formatter_$x_ = () => {
65
65
  return null;
66
66
  },
67
67
  hasBody: (obj) => {
68
- if (obj instanceof CalcitList) {
68
+ if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
69
69
  return obj.len() > 0;
70
70
  }
71
- if (obj instanceof CalcitMap) {
71
+ if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
72
72
  return obj.len() > 0;
73
73
  }
74
74
  if (obj instanceof CalcitSet) {
@@ -77,7 +77,7 @@ export let load_console_formatter_$x_ = () => {
77
77
  return false;
78
78
  },
79
79
  body: (obj, config) => {
80
- if (obj instanceof CalcitList) {
80
+ if (obj instanceof CalcitList || obj instanceof CalcitSliceList) {
81
81
  return ["div", { style: "color: hsl(280, 80%, 60%)" }].concat(obj.toArray().map((x, idx) => {
82
82
  return [
83
83
  "div",
@@ -102,10 +102,10 @@ export let load_console_formatter_$x_ = () => {
102
102
  ret.push(["div", { style: "margin-left: 8px; display: inline-block;" }, embedObject(obj.snd)]);
103
103
  return ret;
104
104
  }
105
- if (obj instanceof CalcitMap) {
105
+ if (obj instanceof CalcitMap || obj instanceof CalcitSliceMap) {
106
106
  let ret = ["div", { style: "color: hsl(280, 80%, 60%)" }];
107
- obj.turnMap();
108
- for (let [k, v] of toPairs(obj.value)) {
107
+ let pairs = obj.pairs();
108
+ for (let [k, v] of pairs) {
109
109
  ret.push([
110
110
  "div",
111
111
  { style: "margin-left: 8px; display: flex;" },