@calcit/procs 0.7.0-a4 → 0.7.0-a5

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.
@@ -539,7 +539,7 @@ export let _$n__$e_ = (x, y) => {
539
539
  }
540
540
  if (x instanceof CalcitTuple) {
541
541
  if (y instanceof CalcitTuple) {
542
- return _$n__$e_(x.tag, y.tag) && _$n__$e_(x.get(1), y.get(1));
542
+ return x.eq(y);
543
543
  }
544
544
  return false;
545
545
  }
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  // CALCIT VERSION
3
- export const calcit_version = "0.7.0-a4";
3
+ export const calcit_version = "0.7.0-a5";
4
4
  import { parse } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
6
6
  import { CalcitSymbol, CalcitTag, CalcitRef, CalcitRecur, newTag, refsRegistry, toString, getStringName, _$n__$e_, hashFunction, } from "./calcit-data.mjs";
package/lib/js-tuple.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { toString } from "./calcit-data.mjs";
1
+ import { _$n__$e_, toString } from "./calcit-data.mjs";
2
2
  export class CalcitTuple {
3
3
  constructor(tagName, extra, klass) {
4
4
  this.tag = tagName;
@@ -33,6 +33,20 @@ export class CalcitTuple {
33
33
  count() {
34
34
  return 1 + this.extra.length;
35
35
  }
36
+ eq(y) {
37
+ if (!_$n__$e_(this.tag, y.tag)) {
38
+ return false;
39
+ }
40
+ if (this.extra.length !== y.extra.length) {
41
+ return false;
42
+ }
43
+ for (let idx = 0; idx < this.extra.length; idx++) {
44
+ if (!_$n__$e_(this.extra[idx], y.extra[idx])) {
45
+ return false;
46
+ }
47
+ }
48
+ return true;
49
+ }
36
50
  toString(disableJsDataWarning = false) {
37
51
  let args = [this.tag, ...this.extra];
38
52
  let content = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.7.0-a4",
3
+ "version": "0.7.0-a5",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^20.2.5",
@@ -581,7 +581,7 @@ export let _$n__$e_ = (x: CalcitValue, y: CalcitValue): boolean => {
581
581
  }
582
582
  if (x instanceof CalcitTuple) {
583
583
  if (y instanceof CalcitTuple) {
584
- return _$n__$e_(x.tag, y.tag) && _$n__$e_(x.get(1), y.get(1));
584
+ return x.eq(y);
585
585
  }
586
586
  return false;
587
587
  }
@@ -1,5 +1,5 @@
1
1
  // CALCIT VERSION
2
- export const calcit_version = "0.7.0-a4";
2
+ export const calcit_version = "0.7.0-a5";
3
3
 
4
4
  import { parse, ICirruNode } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
@@ -1,7 +1,7 @@
1
1
  import { Hash } from "@calcit/ternary-tree";
2
2
 
3
3
  import { CalcitValue } from "./js-primes.mjs";
4
- import { newTag, toString } from "./calcit-data.mjs";
4
+ import { _$n__$e_, newTag, toString } from "./calcit-data.mjs";
5
5
  import { CalcitRecord } from "./js-record.mjs";
6
6
 
7
7
  export class CalcitTuple {
@@ -38,6 +38,20 @@ export class CalcitTuple {
38
38
  count() {
39
39
  return 1 + this.extra.length;
40
40
  }
41
+ eq(y: CalcitTuple): boolean {
42
+ if (!_$n__$e_(this.tag, y.tag)) {
43
+ return false;
44
+ }
45
+ if (this.extra.length !== y.extra.length) {
46
+ return false;
47
+ }
48
+ for (let idx = 0; idx < this.extra.length; idx++) {
49
+ if (!_$n__$e_(this.extra[idx], y.extra[idx])) {
50
+ return false;
51
+ }
52
+ }
53
+ return true;
54
+ }
41
55
  toString(disableJsDataWarning: boolean = false): string {
42
56
  let args = [this.tag, ...this.extra];
43
57
  let content = "";