@calcit/procs 0.13.1 → 0.13.2
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/.yarn/install-state.gz +0 -0
- package/editing-history/202608061714-struct-enum-data-model-v2.md +39 -0
- package/editing-history/202608061731-release-0.13.2.md +18 -0
- package/history/202608061433-required-record-field-access.md +32 -0
- package/lib/calcit-data.mjs +24 -24
- package/lib/calcit.procs.d.mts +43 -43
- package/lib/calcit.procs.mjs +165 -168
- package/lib/custom-formatter.mjs +23 -38
- package/lib/js-cirru.mjs +25 -25
- package/lib/js-enum-def.d.mts +11 -0
- package/lib/{js-enum.mjs → js-enum-def.mjs} +3 -3
- package/lib/{js-tuple.d.mts → js-enum-value.d.mts} +6 -7
- package/lib/{js-tuple.mjs → js-enum-value.mjs} +8 -15
- package/lib/js-list.mjs +6 -6
- package/lib/js-primes.d.mts +5 -5
- package/lib/js-primes.mjs +16 -16
- package/lib/{js-struct.d.mts → js-struct-def.d.mts} +2 -2
- package/lib/{js-struct.mjs → js-struct-def.mjs} +6 -6
- package/lib/{js-record.d.mts → js-struct-value.d.mts} +16 -15
- package/lib/{js-record.mjs → js-struct-value.mjs} +67 -59
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/ts-src/calcit-data.mts +24 -24
- package/ts-src/calcit.procs.mts +165 -168
- package/ts-src/custom-formatter.mts +28 -56
- package/ts-src/js-cirru.mts +26 -26
- package/ts-src/{js-enum.mts → js-enum-def.mts} +7 -7
- package/ts-src/{js-tuple.mts → js-enum-value.mts} +12 -19
- package/ts-src/js-list.mts +6 -6
- package/ts-src/js-primes.mts +16 -16
- package/ts-src/{js-struct.mts → js-struct-def.mts} +7 -7
- package/ts-src/{js-record.mts → js-struct-value.mts} +72 -66
- package/lib/js-enum.d.mts +0 -11
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Struct / Enum data model v2
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
- Split runtime definitions from values: `StructDef` / `EnumDef` versus `Struct` / `Enum`.
|
|
6
|
+
- Replaced outward `record` / `tuple` names with `struct` / `enum`; historical snapshot input remains readable, but new writes and old API calls receive migration diagnostics.
|
|
7
|
+
- Added canonical anonymous forms `%{} _ ...` and `%:: _ ...`.
|
|
8
|
+
- Render named data definitions with symbols, for example `(%{} 'TodoState ...)`, in Rust display and the TypeScript custom formatter.
|
|
9
|
+
|
|
10
|
+
## Field access contract
|
|
11
|
+
|
|
12
|
+
- A struct has a fixed declared field set. Known-field `get` and postfix access return the field's declared type directly rather than `Option<T>`.
|
|
13
|
+
- Missing struct fields produce static diagnostics when type information is available and ordinary runtime errors otherwise; they never turn into silent `nil`/`Option` absence.
|
|
14
|
+
- Map, list, string, and other genuinely fallible collection lookups retain `Option` behavior.
|
|
15
|
+
|
|
16
|
+
## Migration surface
|
|
17
|
+
|
|
18
|
+
- Native APIs moved from `&record:*` / `&tuple:*` to `&struct:*` / `&enum:*`; definition-only operations use `&struct-def:*` / `&enum-def:*`.
|
|
19
|
+
- Public reflection is `struct-definition` / `enum-definition`; predicates distinguish values (`struct?`, `enum?`) from definitions (`struct-def?`, `enum-def?`).
|
|
20
|
+
- Removed calls emit `W_REMOVED_DATA_API` with concrete replacements. Compatibility wrapper bodies also fail explicitly if checking is bypassed.
|
|
21
|
+
- Documentation now presents structs, enums, anonymous structs, and anonymous enums as the public model and keeps old spellings only in the migration table.
|
|
22
|
+
|
|
23
|
+
## Recursive types and regressions
|
|
24
|
+
|
|
25
|
+
- Recursive nominal references stay finite while being resolved.
|
|
26
|
+
- `Optional<Node>` accepts a `nil` leaf and nested non-`nil` nodes.
|
|
27
|
+
- Required invalid recursion and unsupported recursive data-shape forms return normal diagnostics instead of overflowing the stack.
|
|
28
|
+
|
|
29
|
+
## Cross-backend work
|
|
30
|
+
|
|
31
|
+
- Rust, JS, IR, and WASM emitters and runtime tags use the new semantic categories.
|
|
32
|
+
- TypeScript runtime files are separated into struct/enum definition and value modules.
|
|
33
|
+
- Custom formatter headers embed named and anonymous definition markers as `CalcitSymbol`, including `_`.
|
|
34
|
+
|
|
35
|
+
## Real-project validation
|
|
36
|
+
|
|
37
|
+
- Respo was migrated from legacy data APIs and predicates using AST leaf replacements.
|
|
38
|
+
- `Element` stays a struct through `purify-element`, allowing direct typed field access and removing obsolete `Option` unwraps.
|
|
39
|
+
- Respo check-only and its full JS test suite pass when loaded against this repository's newly compiled `@calcit/procs` runtime.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Release 0.13.2
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
- Release the struct / enum data model cleanup merged by PR #301.
|
|
6
|
+
- Publish direct required Struct field access and migration diagnostics for removed record / tuple APIs.
|
|
7
|
+
- Publish symbol-based nominal formatting and matching TypeScript runtime modules.
|
|
8
|
+
|
|
9
|
+
## Version synchronization
|
|
10
|
+
|
|
11
|
+
- `Cargo.toml`: `0.13.2`
|
|
12
|
+
- `package.json`: `0.13.2`
|
|
13
|
+
- `Cargo.lock`: refreshed with `cargo update --workspace`
|
|
14
|
+
|
|
15
|
+
## Release gates
|
|
16
|
+
|
|
17
|
+
- The feature PR passed Test and all CodeQL jobs before merge.
|
|
18
|
+
- The release commit must pass the same GitHub Actions checks before tag `0.13.2` is created.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Required record field access
|
|
2
|
+
|
|
3
|
+
## Background
|
|
4
|
+
|
|
5
|
+
Struct-backed values and loose records both have a fixed runtime field set.
|
|
6
|
+
Direct field syntax therefore must not inherit the optional semantics of the
|
|
7
|
+
generic collection `get` API: a declared field returns its value directly and
|
|
8
|
+
an absent field is an ordinary diagnostic.
|
|
9
|
+
|
|
10
|
+
## Changes
|
|
11
|
+
|
|
12
|
+
- Specialize postfix and tag-headed record access to indexed or required
|
|
13
|
+
record lookup during preprocessing.
|
|
14
|
+
- Make missing native record fields fail consistently in the Rust, JavaScript,
|
|
15
|
+
and WASM runtimes instead of producing nil or undefined.
|
|
16
|
+
- Keep the public collection `get` API optional by guarding required record
|
|
17
|
+
lookup with `record:contains?`.
|
|
18
|
+
- Add Rust and JavaScript regression coverage for direct field specialization
|
|
19
|
+
and missing-field diagnostics.
|
|
20
|
+
- Update the internal `&record:get` schema and documentation to describe the
|
|
21
|
+
required lookup contract.
|
|
22
|
+
|
|
23
|
+
## Verification
|
|
24
|
+
|
|
25
|
+
- `cargo fmt`
|
|
26
|
+
- `cargo clippy -- -D warnings`
|
|
27
|
+
- `cargo test`
|
|
28
|
+
- `yarn compile`
|
|
29
|
+
- `yarn check-all`
|
|
30
|
+
- `yarn check-agent-interface`
|
|
31
|
+
- Respo `cr calcit.cirru --check-only`
|
|
32
|
+
- Respo `cr calcit.cirru js`
|
package/lib/calcit-data.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import { overwriteHashGenerator, valueHash, mergeValueHash } from "@calcit/terna
|
|
|
2
2
|
import { overwriteComparator } from "@calcit/ternary-tree";
|
|
3
3
|
import { overwriteMapComparator } from "./js-map.mjs";
|
|
4
4
|
import { disableListStructureCheck } from "@calcit/ternary-tree";
|
|
5
|
-
import {
|
|
5
|
+
import { CalcitStructValue, fieldsEqual } from "./js-struct-value.mjs";
|
|
6
6
|
import { CalcitImpl } from "./js-impl.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { CalcitStructDef } from "./js-struct-def.mjs";
|
|
8
|
+
import { CalcitEnumDef } from "./js-enum-def.mjs";
|
|
9
9
|
import { CalcitMap, CalcitSliceMap } from "./js-map.mjs";
|
|
10
10
|
import { _$n_compare } from "./js-primes.mjs";
|
|
11
11
|
import { CalcitList, CalcitSliceList } from "./js-list.mjs";
|
|
12
12
|
import { CalcitSet, overwriteSetComparator } from "./js-set.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { CalcitEnumValue } from "./js-enum-value.mjs";
|
|
14
14
|
import { CalcitTrait } from "./js-trait.mjs";
|
|
15
15
|
import { CalcitCirruQuote, cirru_deep_equal } from "./js-cirru.mjs";
|
|
16
16
|
import { CalcitRef } from "./js-ref.mjs";
|
|
@@ -64,7 +64,7 @@ export let isNestedCalcitData = (x) => {
|
|
|
64
64
|
if (x instanceof CalcitMap || x instanceof CalcitSliceMap) {
|
|
65
65
|
return x.len() > 0;
|
|
66
66
|
}
|
|
67
|
-
if (x instanceof
|
|
67
|
+
if (x instanceof CalcitStructValue) {
|
|
68
68
|
return x.fields.length > 0;
|
|
69
69
|
}
|
|
70
70
|
if (x instanceof CalcitImpl) {
|
|
@@ -82,7 +82,7 @@ export let tipNestedCalcitData = (x) => {
|
|
|
82
82
|
if (x instanceof CalcitMap || x instanceof CalcitSliceMap) {
|
|
83
83
|
return "'{}...";
|
|
84
84
|
}
|
|
85
|
-
if (x instanceof
|
|
85
|
+
if (x instanceof CalcitStructValue) {
|
|
86
86
|
return "'%{}...";
|
|
87
87
|
}
|
|
88
88
|
if (x instanceof CalcitImpl) {
|
|
@@ -228,7 +228,7 @@ export let hashFunction = (x) => {
|
|
|
228
228
|
x.cachedHash = h;
|
|
229
229
|
return h;
|
|
230
230
|
}
|
|
231
|
-
if (x instanceof
|
|
231
|
+
if (x instanceof CalcitEnumValue) {
|
|
232
232
|
let base = defaultHash_tuple;
|
|
233
233
|
base = mergeValueHash(base, hashFunction(x.tag));
|
|
234
234
|
for (let idx = 0; idx < x.extra.length; idx++) {
|
|
@@ -293,7 +293,7 @@ export let hashFunction = (x) => {
|
|
|
293
293
|
x.cachedHash = base;
|
|
294
294
|
return base;
|
|
295
295
|
}
|
|
296
|
-
if (x instanceof
|
|
296
|
+
if (x instanceof CalcitStructValue) {
|
|
297
297
|
let base = defaultHash_record;
|
|
298
298
|
for (let idx = 0; idx < x.fields.length; idx++) {
|
|
299
299
|
base = mergeValueHash(base, hashFunction(x.fields[idx]));
|
|
@@ -315,7 +315,7 @@ export let hashFunction = (x) => {
|
|
|
315
315
|
x.cachedHash = base;
|
|
316
316
|
return base;
|
|
317
317
|
}
|
|
318
|
-
if (x instanceof
|
|
318
|
+
if (x instanceof CalcitStructDef) {
|
|
319
319
|
let base = defaultHash_struct;
|
|
320
320
|
base = mergeValueHash(base, hashFunction(x.name));
|
|
321
321
|
for (let idx = 0; idx < x.fields.length; idx++) {
|
|
@@ -328,7 +328,7 @@ export let hashFunction = (x) => {
|
|
|
328
328
|
x.cachedHash = base;
|
|
329
329
|
return base;
|
|
330
330
|
}
|
|
331
|
-
if (x instanceof
|
|
331
|
+
if (x instanceof CalcitEnumDef) {
|
|
332
332
|
let base = defaultHash_enum;
|
|
333
333
|
base = mergeValueHash(base, hashFunction(x.prototype));
|
|
334
334
|
for (let impl of x.impls) {
|
|
@@ -412,16 +412,16 @@ export let toString = (x, escaped, disableJsDataWarning = false) => {
|
|
|
412
412
|
if (x instanceof CalcitSet) {
|
|
413
413
|
return x.toString(disableJsDataWarning);
|
|
414
414
|
}
|
|
415
|
-
if (x instanceof
|
|
415
|
+
if (x instanceof CalcitStructValue) {
|
|
416
416
|
return x.toString(disableJsDataWarning);
|
|
417
417
|
}
|
|
418
418
|
if (x instanceof CalcitImpl) {
|
|
419
419
|
return x.toString(disableJsDataWarning);
|
|
420
420
|
}
|
|
421
|
-
if (x instanceof
|
|
421
|
+
if (x instanceof CalcitStructDef) {
|
|
422
422
|
return x.toString(disableJsDataWarning);
|
|
423
423
|
}
|
|
424
|
-
if (x instanceof
|
|
424
|
+
if (x instanceof CalcitEnumDef) {
|
|
425
425
|
return x.toString();
|
|
426
426
|
}
|
|
427
427
|
if (x instanceof CalcitTrait) {
|
|
@@ -430,7 +430,7 @@ export let toString = (x, escaped, disableJsDataWarning = false) => {
|
|
|
430
430
|
if (x instanceof CalcitRef) {
|
|
431
431
|
return x.toString();
|
|
432
432
|
}
|
|
433
|
-
if (x instanceof
|
|
433
|
+
if (x instanceof CalcitEnumValue) {
|
|
434
434
|
return x.toString(disableJsDataWarning);
|
|
435
435
|
}
|
|
436
436
|
if (x instanceof CalcitCirruQuote) {
|
|
@@ -500,7 +500,7 @@ let to_js_data_inner = (x, addColon) => {
|
|
|
500
500
|
}
|
|
501
501
|
return Symbol(x.value);
|
|
502
502
|
}
|
|
503
|
-
if (x instanceof
|
|
503
|
+
if (x instanceof CalcitEnumValue) {
|
|
504
504
|
var result = [to_js_data_inner(x.tag, false)];
|
|
505
505
|
for (let i = 0; i < x.extra.length; i++) {
|
|
506
506
|
let item = x.extra[i];
|
|
@@ -533,7 +533,7 @@ let to_js_data_inner = (x, addColon) => {
|
|
|
533
533
|
});
|
|
534
534
|
return result;
|
|
535
535
|
}
|
|
536
|
-
if (x instanceof
|
|
536
|
+
if (x instanceof CalcitStructValue) {
|
|
537
537
|
let result = {};
|
|
538
538
|
for (let idx = 0; idx < x.fields.length; idx++) {
|
|
539
539
|
result[x.fields[idx].value] = to_js_data_inner(x.values[idx], false);
|
|
@@ -654,8 +654,8 @@ export let _$n__$e_ = (x, y) => {
|
|
|
654
654
|
}
|
|
655
655
|
return false;
|
|
656
656
|
}
|
|
657
|
-
if (x instanceof
|
|
658
|
-
if (y instanceof
|
|
657
|
+
if (x instanceof CalcitEnumValue) {
|
|
658
|
+
if (y instanceof CalcitEnumValue) {
|
|
659
659
|
return x.eq(y);
|
|
660
660
|
}
|
|
661
661
|
return false;
|
|
@@ -704,8 +704,8 @@ export let _$n__$e_ = (x, y) => {
|
|
|
704
704
|
}
|
|
705
705
|
return false;
|
|
706
706
|
}
|
|
707
|
-
if (x instanceof
|
|
708
|
-
if (y instanceof
|
|
707
|
+
if (x instanceof CalcitStructValue) {
|
|
708
|
+
if (y instanceof CalcitStructValue) {
|
|
709
709
|
if (x.name !== y.name) {
|
|
710
710
|
return false;
|
|
711
711
|
}
|
|
@@ -750,14 +750,14 @@ export let _$n__$e_ = (x, y) => {
|
|
|
750
750
|
}
|
|
751
751
|
return false;
|
|
752
752
|
}
|
|
753
|
-
if (x instanceof
|
|
754
|
-
if (y instanceof
|
|
753
|
+
if (x instanceof CalcitStructDef) {
|
|
754
|
+
if (y instanceof CalcitStructDef) {
|
|
755
755
|
return x.name === y.name && fieldsEqual(x.fields, y.fields);
|
|
756
756
|
}
|
|
757
757
|
return false;
|
|
758
758
|
}
|
|
759
|
-
if (x instanceof
|
|
760
|
-
if (y instanceof
|
|
759
|
+
if (x instanceof CalcitEnumDef) {
|
|
760
|
+
if (y instanceof CalcitEnumDef) {
|
|
761
761
|
return x.name === y.name;
|
|
762
762
|
}
|
|
763
763
|
return false;
|
package/lib/calcit.procs.d.mts
CHANGED
|
@@ -45,21 +45,21 @@ import { ICirruNode } from "@cirru/parser.ts";
|
|
|
45
45
|
import { CalcitValue } from "./js-primes.mjs";
|
|
46
46
|
import { CalcitSymbol, CalcitTag, CalcitFn, CalcitRecur } from "./calcit-data.mjs";
|
|
47
47
|
import { CalcitRef } from "./js-ref.mjs";
|
|
48
|
-
import {
|
|
48
|
+
import { CalcitStructValue } from "./js-struct-value.mjs";
|
|
49
49
|
import { CalcitImpl } from "./js-impl.mjs";
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
50
|
+
import { CalcitStructDef } from "./js-struct-def.mjs";
|
|
51
|
+
import { CalcitEnumDef } from "./js-enum-def.mjs";
|
|
52
52
|
import { CalcitTrait } from "./js-trait.mjs";
|
|
53
53
|
export * from "./calcit-data.mjs";
|
|
54
|
-
export * from "./js-
|
|
54
|
+
export * from "./js-struct-value.mjs";
|
|
55
55
|
export * from "./js-impl.mjs";
|
|
56
|
-
export * from "./js-struct.mjs";
|
|
57
|
-
export * from "./js-enum.mjs";
|
|
56
|
+
export * from "./js-struct-def.mjs";
|
|
57
|
+
export * from "./js-enum-def.mjs";
|
|
58
58
|
export * from "./js-map.mjs";
|
|
59
59
|
export * from "./js-list.mjs";
|
|
60
60
|
export * from "./js-set.mjs";
|
|
61
61
|
export * from "./js-primes.mjs";
|
|
62
|
-
export * from "./js-
|
|
62
|
+
export * from "./js-enum-value.mjs";
|
|
63
63
|
export * from "./js-trait.mjs";
|
|
64
64
|
export * from "./custom-formatter.mjs";
|
|
65
65
|
export * from "./js-cirru.mjs";
|
|
@@ -70,23 +70,23 @@ export { _$n_compare } from "./js-primes.mjs";
|
|
|
70
70
|
import { CalcitList, CalcitSliceList } from "./js-list.mjs";
|
|
71
71
|
import { CalcitMap, CalcitSliceMap } from "./js-map.mjs";
|
|
72
72
|
import { CalcitSet } from "./js-set.mjs";
|
|
73
|
-
import {
|
|
73
|
+
import { CalcitEnumValue } from "./js-enum-value.mjs";
|
|
74
74
|
import { CalcitCirruQuote } from "./js-cirru.mjs";
|
|
75
75
|
export declare let type_of: (x: any) => CalcitTag;
|
|
76
76
|
export declare let _$n_trait_$o__$o_new: (name: CalcitValue, methods: CalcitValue) => CalcitTrait;
|
|
77
77
|
export declare let _$n_assert_traits: (value: CalcitValue, traitDef: CalcitValue) => CalcitValue;
|
|
78
|
-
export declare let defstruct: (name: CalcitValue, ...entries: CalcitValue[]) =>
|
|
79
|
-
export declare let defenum: (name: CalcitValue, ...variants: CalcitValue[]) =>
|
|
78
|
+
export declare let defstruct: (name: CalcitValue, ...entries: CalcitValue[]) => CalcitStructDef;
|
|
79
|
+
export declare let defenum: (name: CalcitValue, ...variants: CalcitValue[]) => CalcitEnumDef;
|
|
80
80
|
export declare let _$n_impl_$o__$o_new: (name: CalcitValue, ...pairs: CalcitValue[]) => CalcitImpl;
|
|
81
|
-
export declare let _$
|
|
82
|
-
export declare let _$
|
|
81
|
+
export declare let _$n_struct_def_$o_new: (name: CalcitValue, ...entries: CalcitValue[]) => CalcitStructDef;
|
|
82
|
+
export declare let _$n_enum_def_$o_new: (name: CalcitValue, ...variants: CalcitValue[]) => CalcitEnumDef;
|
|
83
83
|
export declare let print: (...xs: CalcitValue[]) => void;
|
|
84
84
|
export declare function _$n_list_$o_count(x: CalcitValue): number;
|
|
85
85
|
export declare function _$n_str_$o_count(x: CalcitValue): number;
|
|
86
86
|
export declare function _$n_map_$o_count(x: CalcitValue): number;
|
|
87
|
-
export declare function _$
|
|
88
|
-
export declare function _$
|
|
89
|
-
export declare function _$
|
|
87
|
+
export declare function _$n_struct_$o_count(x: CalcitValue): number;
|
|
88
|
+
export declare function _$n_struct_$o_field_tag(x: CalcitValue, idx: CalcitValue): CalcitTag;
|
|
89
|
+
export declare function _$n_struct_$o_nth(x: CalcitValue, idx: CalcitValue): CalcitValue;
|
|
90
90
|
export declare function _$n_set_$o_count(x: CalcitValue): number;
|
|
91
91
|
export declare let _$L_: (...xs: CalcitValue[]) => CalcitSliceList;
|
|
92
92
|
export declare let _SQUO_: (...xs: CalcitValue[]) => CalcitSliceList;
|
|
@@ -101,33 +101,33 @@ export declare let _$n_str: (x: CalcitValue) => string;
|
|
|
101
101
|
export declare let _$n_str_$o_contains_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
102
102
|
export declare let _$n_list_$o_contains_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
103
103
|
export declare let _$n_map_$o_contains_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
104
|
-
export declare let _$
|
|
104
|
+
export declare let _$n_struct_$o_contains_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
105
105
|
export declare let _$n_str_$o_includes_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
106
106
|
export declare let _$n_list_$o_includes_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
107
107
|
export declare let _$n_map_$o_includes_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
108
108
|
export declare let _$n_set_$o_includes_$q_: (xs: CalcitValue, x: CalcitValue) => boolean;
|
|
109
109
|
export declare let _$n_str_$o_nth: (xs: CalcitValue, k: CalcitValue) => string;
|
|
110
110
|
export declare let _$n_list_$o_nth: (xs: CalcitValue, k: CalcitValue) => CalcitValue;
|
|
111
|
-
export declare let _$
|
|
112
|
-
export declare let _$
|
|
113
|
-
export declare let _$
|
|
114
|
-
export declare let _$
|
|
115
|
-
export declare let _$
|
|
116
|
-
export declare let _$
|
|
117
|
-
export declare let _$
|
|
118
|
-
export declare let _$
|
|
119
|
-
export declare let _$
|
|
120
|
-
export declare let _$
|
|
121
|
-
export declare let _$
|
|
122
|
-
export declare let _$
|
|
111
|
+
export declare let _$n_enum_$o_nth: (xs: CalcitValue, k: CalcitValue) => CalcitValue;
|
|
112
|
+
export declare let _$n_enum_$o_count: (xs: CalcitValue) => number;
|
|
113
|
+
export declare let _$n_enum_$o_impls: (x: CalcitEnumValue) => CalcitSliceList;
|
|
114
|
+
export declare let _$n_enum_$o_params: (x: CalcitEnumValue) => CalcitSliceList;
|
|
115
|
+
export declare let _$n_enum_$o_with_impls: (x: CalcitEnumValue, y: CalcitValue) => CalcitEnumValue;
|
|
116
|
+
export declare let _$n_enum_$o_impl_traits: (x: CalcitValue, ...traits: CalcitValue[]) => CalcitEnumValue;
|
|
117
|
+
export declare let _$n_enum_$o_definition: (x: CalcitEnumValue) => CalcitEnumDef;
|
|
118
|
+
export declare let _$n_enum_def_$o_has_variant_$q_: (enumPrototype: CalcitValue, variantTag: CalcitTag) => boolean;
|
|
119
|
+
export declare let _$n_enum_def_$o_has_variant: (enumPrototype: CalcitValue, variantTag: CalcitTag) => boolean;
|
|
120
|
+
export declare let _$n_enum_def_$o_variant_arity: (enumPrototype: CalcitValue, variantTag: CalcitTag) => number;
|
|
121
|
+
export declare let _$n_enum_$o_validate: (enumValue: CalcitValue, tag: CalcitValue) => CalcitValue;
|
|
122
|
+
export declare let _$n_struct_$o_get: (xs: CalcitValue, k: CalcitTag) => CalcitValue;
|
|
123
123
|
export declare let _$n_list_$o_assoc: (xs: CalcitValue, k: CalcitValue, v: CalcitValue) => CalcitList;
|
|
124
|
-
export declare let _$
|
|
124
|
+
export declare let _$n_enum_$o_assoc: (xs: CalcitValue, k: CalcitValue, v: CalcitValue) => CalcitEnumValue;
|
|
125
125
|
export declare let _$n_map_$o_assoc: (xs: CalcitValue, ...args: CalcitValue[]) => CalcitMap | CalcitSliceMap;
|
|
126
|
-
export declare let _$
|
|
127
|
-
export declare let _$
|
|
128
|
-
export declare let _$
|
|
129
|
-
export declare let _$
|
|
130
|
-
export declare let _$
|
|
126
|
+
export declare let _$n_struct_$o_assoc: (xs: CalcitValue, k: CalcitValue, v: CalcitValue) => CalcitStructValue;
|
|
127
|
+
export declare let _$n_struct_$o_impls: (xs: CalcitValue) => CalcitSliceList;
|
|
128
|
+
export declare let _$n_struct_$o_impl_traits: (xs: CalcitValue, ...traits: CalcitValue[]) => CalcitStructValue;
|
|
129
|
+
export declare let _$n_struct_def_$o_impl_traits: (xs: CalcitValue, ...traits: CalcitValue[]) => CalcitStructDef;
|
|
130
|
+
export declare let _$n_enum_def_$o_impl_traits: (xs: CalcitValue, ...traits: CalcitValue[]) => CalcitEnumDef;
|
|
131
131
|
export declare let _$n_impl_$o_origin: (impl: CalcitValue) => CalcitValue;
|
|
132
132
|
export declare let _$n_impl_$o_get: (impl: CalcitValue, name: CalcitValue) => CalcitValue;
|
|
133
133
|
export declare let _$n_impl_$o_nth: (impl: CalcitValue, index: CalcitValue) => CalcitValue;
|
|
@@ -236,8 +236,8 @@ export declare let list_$q_: (x: CalcitValue) => boolean;
|
|
|
236
236
|
export declare let set_$q_: (x: CalcitValue) => boolean;
|
|
237
237
|
export declare let fn_$q_: (x: CalcitValue) => boolean;
|
|
238
238
|
export declare let ref_$q_: (x: CalcitValue) => boolean;
|
|
239
|
-
export declare let
|
|
240
|
-
export declare let
|
|
239
|
+
export declare let struct_$q_: (x: CalcitValue) => boolean;
|
|
240
|
+
export declare let enum_$q_: (x: CalcitValue) => boolean;
|
|
241
241
|
export declare let buffer_$q_: (x: CalcitValue) => boolean;
|
|
242
242
|
export declare let _$n_str_$o_escape: (x: string) => string;
|
|
243
243
|
export declare let read_file: (path: string) => string;
|
|
@@ -256,11 +256,11 @@ type DataShapeNode = {
|
|
|
256
256
|
value: number;
|
|
257
257
|
} | {
|
|
258
258
|
kind: "struct";
|
|
259
|
-
nominal:
|
|
259
|
+
nominal: CalcitStructDef;
|
|
260
260
|
fields: Array<[string, number]>;
|
|
261
261
|
} | {
|
|
262
262
|
kind: "enum";
|
|
263
|
-
nominal:
|
|
263
|
+
nominal: CalcitEnumDef;
|
|
264
264
|
variants: Array<{
|
|
265
265
|
tag: string;
|
|
266
266
|
payload: number[];
|
|
@@ -284,9 +284,9 @@ export declare let js_array: (...xs: CalcitValue[]) => CalcitValue[];
|
|
|
284
284
|
/** for..await alternative with function */
|
|
285
285
|
export declare let js_for_await: (stream: AsyncIterableIterator<CalcitValue>, f: (v: CalcitValue) => Promise<CalcitValue>) => Promise<CalcitValue>;
|
|
286
286
|
export declare let _$n_js_object: (...xs: CalcitValue[]) => Record<string, CalcitValue>;
|
|
287
|
-
export declare let _$o__$o_: (tagName: CalcitValue, ...extra: CalcitValue[]) =>
|
|
288
|
-
export declare let _PCT__$o__$o_: (enumPrototype: CalcitValue, tag: CalcitValue, ...extra: CalcitValue[]) =>
|
|
289
|
-
export declare let _PCT__PCT__$o__$o_: (impl: CalcitValue, enumPrototype: CalcitValue, tag: CalcitValue, ...extra: CalcitValue[]) =>
|
|
287
|
+
export declare let _$o__$o_: (tagName: CalcitValue, ...extra: CalcitValue[]) => CalcitEnumValue;
|
|
288
|
+
export declare let _PCT__$o__$o_: (enumPrototype: CalcitValue, tag: CalcitValue, ...extra: CalcitValue[]) => CalcitEnumValue;
|
|
289
|
+
export declare let _PCT__PCT__$o__$o_: (impl: CalcitValue, enumPrototype: CalcitValue, tag: CalcitValue, ...extra: CalcitValue[]) => CalcitEnumValue;
|
|
290
290
|
type CalcitImplEntry = CalcitImpl | CalcitList | CalcitSliceList | null;
|
|
291
291
|
declare let calcit_builtin_impls: {
|
|
292
292
|
number: CalcitImplEntry;
|
|
@@ -295,8 +295,8 @@ declare let calcit_builtin_impls: {
|
|
|
295
295
|
list: CalcitImplEntry;
|
|
296
296
|
map: CalcitImplEntry;
|
|
297
297
|
fn: CalcitImplEntry;
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
enum: CalcitImplEntry;
|
|
299
|
+
struct: CalcitImplEntry;
|
|
300
300
|
scalar: CalcitImplEntry;
|
|
301
301
|
};
|
|
302
302
|
export declare let register_calcit_builtin_impls: (options: typeof calcit_builtin_impls) => void;
|