@calcit/procs 0.6.1 → 0.6.4

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,6 +1,6 @@
1
1
  var _a;
2
2
  // CALCIT VERSION
3
- export const calcit_version = "0.6.1";
3
+ export const calcit_version = "0.6.4";
4
4
  import { parse } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
6
6
  import "./js-primes.mjs";
@@ -118,15 +118,17 @@ export let defatom = (path, x) => {
118
118
  refsRegistry.set(path, v);
119
119
  return v;
120
120
  };
121
+ var atomCounter = 0;
122
+ export let atom = (x) => {
123
+ atomCounter = atomCounter + 1;
124
+ let v = new CalcitRef(x, `atom-${atomCounter}`);
125
+ return v;
126
+ };
121
127
  export let peekDefatom = (path) => {
122
128
  return refsRegistry.get(path);
123
129
  };
124
130
  export let deref = (x) => {
125
- let a = refsRegistry.get(x.path);
126
- if (!(a instanceof CalcitRef)) {
127
- console.warn("Can not find ref:", x);
128
- }
129
- return a.value;
131
+ return x.value;
130
132
  };
131
133
  export let _$n__ADD_ = (x, y) => {
132
134
  return x + y;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.6.1",
3
+ "version": "0.6.4",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
- "@types/node": "^18.0.6",
6
+ "@types/node": "^18.6.1",
7
7
  "typescript": "^4.7.4"
8
8
  },
9
9
  "scripts": {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@calcit/ternary-tree": "0.0.19",
22
- "@cirru/parser.ts": "^0.0.5",
22
+ "@cirru/parser.ts": "^0.0.6",
23
23
  "@cirru/writer.ts": "^0.1.3"
24
24
  }
25
25
  }
@@ -1,5 +1,5 @@
1
1
  // CALCIT VERSION
2
- export const calcit_version = "0.6.1";
2
+ export const calcit_version = "0.6.4";
3
3
 
4
4
  import { parse, ICirruNode } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
@@ -143,16 +143,20 @@ export let defatom = (path: string, x: CalcitValue): CalcitValue => {
143
143
  return v;
144
144
  };
145
145
 
146
+ var atomCounter = 0;
147
+
148
+ export let atom = (x: CalcitValue): CalcitValue => {
149
+ atomCounter = atomCounter + 1;
150
+ let v = new CalcitRef(x, `atom-${atomCounter}`);
151
+ return v;
152
+ };
153
+
146
154
  export let peekDefatom = (path: string): CalcitRef => {
147
155
  return refsRegistry.get(path);
148
156
  };
149
157
 
150
158
  export let deref = (x: CalcitRef): CalcitValue => {
151
- let a = refsRegistry.get(x.path);
152
- if (!(a instanceof CalcitRef)) {
153
- console.warn("Can not find ref:", x);
154
- }
155
- return a.value;
159
+ return x.value;
156
160
  };
157
161
 
158
162
  export let _$n__ADD_ = (x: number, y: number): number => {