calcit 0.12.32

Interpreter and js codegen for Calcit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107

{} (:about "|Machine-generated snapshot. Do not edit directly — changes will be overwritten. Use `cr query` to inspect and `cr edit`/`cr tree` to modify. Run `cr docs agents --full` first. Manual edits must follow format and schema conventions, then run `cr edit format`.") (:package |calcit)
  :configs $ {} (:init-fn |calcit.core/println!) (:reload-fn |calcit.core/println!) (:version |0.0.0)
    :modules $ []
  :entries $ {}
  :files $ {}
    |calcit.core $ %{} :FileEntry
      :defs $ {}
        |#{} $ %{} :CodeEntry (:doc "|internal function for creating sets\nSyntax: (#{} & elements)\nParams: elements (any, variadic)\nReturns: set\nCreates new set from provided elements")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :set)
              :args $ []
        |%:: $ %{} :CodeEntry (:doc "|internal function for creating enum tuples\nSyntax: (%:: enum tag & values)\nParams: enum (record/enum), tag (tag), values (any, variable number)\nReturns: tuple with enum metadata\nCreates a tagged tuple that carries enum metadata for validation (use &tuple:impl-traits to attach impls)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :dynamic :dynamic
        |%<- $ %{} :CodeEntry (:doc "|pass value as `%` into several expressions, in reversed order") (:schema :dynamic)
          :code $ quote
            defmacro %<- (& xs)
              if (&list:empty? xs) (raise "|%<- expects at least 1 expression")
              quasiquote $ ->%
                ~@ $ reverse xs
          :examples $ []
        |%err $ %{} :CodeEntry (:doc "|Create Err variant of Result")
          :code $ quote
            defn %err (message) (%:: Result :err message)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] 'E
              :generics $ [] 'T 'E
        |%none $ %{} :CodeEntry (:doc "|Create None variant of Option")
          :code $ quote
            defn %none () $ %:: Option :none
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ []
              :generics $ [] 'T
        |%ok $ %{} :CodeEntry (:doc "|Create Ok variant of Result")
          :code $ quote
            defn %ok (value) (%:: Result :ok value)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] 'T
              :generics $ [] 'T 'E
        |%some $ %{} :CodeEntry (:doc "|Create Some variant of Option")
          :code $ quote
            defn %some (value) (%:: Option :some value)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] 'T
              :generics $ [] 'T
        |%{} $ %{} :CodeEntry (:doc "|Macro for constructing struct-based records\nSyntax: (%{} StructName & field-value-pairs)\nParams: StructName (struct from defstruct), field-value-pairs (key-value list pairs, variadic)\nReturns: record")
          :code $ quote
            defmacro %{} (R & xs)
              if
                not $ and (list? xs) (every? xs list?)
                raise $ str-spaced "|%{} expects field entries in list, got:" xs
              &let
                args $ &list:concat & xs
                quasiquote $ &%{} ~R ~@args
          :examples $ []
            quote $ let
                Point $ defstruct Point (:x :number) (:y :number)
                rec $ %{} Point ([] :x 1) ([] :y 2)
              assert= 1 $ :x rec
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |%{}? $ %{} :CodeEntry (:doc "|Partial record constructor — allows omitting optional fields\nOmitted fields default to nil when using a struct prototype.\nSyntax: (%{}? R & field-value-pairs)\nParams: R (struct), field-value-pairs (key-value list pairs, variadic)\nReturns: record")
          :code $ quote
            defmacro %{}? (R & xs)
              if
                not $ and (list? xs) (every? xs list?)
                raise $ str-spaced "|%{}? expects field entries in list, got:" xs
              &let
                args $ &list:concat & xs
                quasiquote $ &%{}? ~R ~@args
          :examples $ []
            quote $ let
                Point $ defstruct Point (:x :number) (:y :number)
                p $ %{}? Point (:x 1)
              assert= nil $ :y p
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |& $ %{} :CodeEntry (:doc "|internal syntax for spreading in function definition and call\nSyntax: (& rest-args) in params or (f & args) in calls\nParams: varies based on context\nReturns: varies based on context\nMarks rest parameters or argument spreading") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&%{} $ %{} :CodeEntry (:doc "|internal function for native record creation\nSyntax: (&%{} name & key-value-pairs)\nParams: name (keyword), key-value-pairs (any, variadic)\nReturns: record\nCreates native record with name and fields") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&%{}? $ %{} :CodeEntry (:doc "|internal function for partial record construction\nSyntax: (&%{}? proto & key-value-pairs)\nParams: proto (struct), key-value-pairs (any, variadic)\nReturns: record\nMissing fields default to nil.") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&* $ %{} :CodeEntry (:doc "|internal function for multiplication\nSyntax: (&* a b)\nParams: a (number), b (number)\nReturns: number\nMultiplies two numbers together, supports integers and floats")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&+ $ %{} :CodeEntry (:doc "|internal function for addition\nSyntax: (&+ a b)\nParams: a (number), b (number)\nReturns: number\nAdds two numbers together, supports integers and floats")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&- $ %{} :CodeEntry (:doc "|internal function for subtraction\nSyntax: (&- a b)\nParams: a (number), b (number)\nReturns: number\nSubtracts second number from first, supports integers and floats")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&/ $ %{} :CodeEntry (:doc "|internal function for division\nSyntax: (&/ a b)\nParams: a (number), b (number)\nReturns: number\nDivides first number by second, returns float result")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&< $ %{} :CodeEntry (:doc "|internal function for less than comparison\nSyntax: (&< a b & values)\nParams: a (number), b (number), values (number, variadic)\nReturns: boolean\nReturns true if values are in ascending order")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number :number
        |&<= $ %{} :CodeEntry (:doc "|Less than or equal comparison for two values")
          :code $ quote
            defn &<= (a b)
              assert "|expects numbers for &<=" $ if (number? a) (number? b)
              if (&< a b) true $ &= a b
          :examples $ []
            quote $ assert= true (&<= 3 5)
            quote $ assert= true (&<= 5 5)
            quote $ assert= false (&<= 5 3)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number :number
        |&= $ %{} :CodeEntry (:doc "|internal function for equality comparison\nSyntax: (&= a b & values)\nParams: a (any), b (any), values (any, variadic)\nReturns: boolean\nReturns true if all values are equal using deep comparison")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |&> $ %{} :CodeEntry (:doc "|internal function for greater than comparison\nSyntax: (&> a b & values)\nParams: a (number), b (number), values (number, variadic)\nReturns: boolean\nReturns true if values are in descending order")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number :number
        |&>= $ %{} :CodeEntry (:doc "|Greater than or equal comparison for two values")
          :code $ quote
            defn &>= (a b)
              assert "|expects numbers for &>=" $ if (number? a) (number? b)
              if (&> a b) true $ &= a b
          :examples $ []
            quote $ assert= true (&>= 5 3)
            quote $ assert= true (&>= 5 5)
            quote $ assert= false (&>= 3 5)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number :number
        |&atom:deref $ %{} :CodeEntry (:doc "|internal function for dereferencing atoms\nSyntax: (&atom:deref atom)\nParams: atom (atom)\nReturns: any\nReturns current value of atom")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :ref
        |&buf-list:concat $ %{} :CodeEntry (:doc "|internal function for appending all elements of a list onto a mutable buffer list\\nSyntax: (&buf-list:concat buf xs)\\nParams: buf (buf-list), xs (list)\\nReturns: buf-list\\nMutates buf by appending all elements from xs; returns the same buf")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                buf $ &buf-list:new
              &buf-list:concat buf $ [] 1 2 3
              assert= 3 $ &buf-list:count buf
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tag :list
        |&buf-list:count $ %{} :CodeEntry (:doc "|internal function for getting the element count of a mutable buffer list\\nSyntax: (&buf-list:count buf)\\nParams: buf (buf-list)\\nReturns: number\\nReturns the number of elements currently in the buffer")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                buf $ &buf-list:new
              &buf-list:push buf 42
              assert= 1 $ &buf-list:count buf
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :tag
        |&buf-list:new $ %{} :CodeEntry (:doc "|internal function for creating a new mutable buffer list\\nSyntax: (&buf-list:new)\\nParams: none\\nReturns: buf-list\\nCreates a new empty mutable append-only buffer list, used for efficient incremental accumulation before converting to an immutable list")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= 0
              &buf-list:count $ &buf-list:new
          :schema $ :: :fn
            {} (:return :tag)
              :args $ []
        |&buf-list:push $ %{} :CodeEntry (:doc "|internal function for pushing an item onto a mutable buffer list\\nSyntax: (&buf-list:push buf item)\\nParams: buf (buf-list), item (any)\\nReturns: buf-list\\nMutates buf by appending item to end; returns the same buf")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                buf $ &buf-list:new
              &buf-list:push buf 10
              &buf-list:push buf 20
              assert= 2 $ &buf-list:count buf
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tag :dynamic
        |&buf-list:to-list $ %{} :CodeEntry (:doc "|internal function for converting a mutable buffer list to an immutable list\\nSyntax: (&buf-list:to-list buf)\\nParams: buf (buf-list)\\nReturns: list\\nFreezes the mutable buffer into a regular immutable list")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                buf $ &buf-list:new
              &buf-list:push buf 1
              &buf-list:push buf 2
              assert= ([] 1 2) (&buf-list:to-list buf)
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :tag
        |&buffer $ %{} :CodeEntry (:doc "|internal function for buffer operations\nSyntax: (&buffer data)\nParams: data (list of numbers or bytes)\nReturns: buffer object\nCreates a binary buffer from list of byte values")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :buffer)
              :args $ [] :dynamic
        |&call-spread $ %{} :CodeEntry (:doc "|internal syntax for handling & spreading in function calls\nSyntax: (&call-spread fn args)\nParams: fn (function), args (list with spread)\nReturns: function call result\nHandles argument spreading in function calls") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&case $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro &case (item default pattern & others)
              if
                not $ and (list? pattern)
                  &= 2 $ &list:count pattern
                raise $ str-spaced "|`case` expects pattern in a pair, got:" pattern
              let
                  x $ &list:first pattern
                  branch $ last pattern
                quasiquote $ if (&= ~item ~x) ~branch
                  ~ $ if (&list:empty? others) default
                    quasiquote $ &case ~item ~default ~@others
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic :dynamic)
        |&cirru-nth $ %{} :CodeEntry (:doc "|internal function for Cirru nth operation\nSyntax: (&cirru-nth cirru-list index)\nParams: cirru-list (cirru quote list), index (number)\nReturns: cirru node or nil\nGets nth element from Cirru list node, returns nil if index out of bounds")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :number
        |&cirru-quote:to-list $ %{} :CodeEntry (:doc "|internal function for converting Cirru quote to list\nSyntax: (&cirru-quote:to-list quote)\nParams: quote (cirru-quote)\nReturns: list\nConverts Cirru quote structure to regular list")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :dynamic
        |&cirru-type $ %{} :CodeEntry (:doc "|internal function for getting Cirru type\nSyntax: (&cirru-type cirru-node)\nParams: cirru-node (cirru quote)\nReturns: keyword (:leaf or :list)\nReturns type of Cirru node, either :leaf for atoms or :list for expressions")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :dynamic
        |&compare $ %{} :CodeEntry (:doc "|internal function for native comparison\nSyntax: (&compare a b)\nParams: a (any), b (any)\nReturns: number (-1, 0, or 1)\nPerforms three-way comparison returning -1 (less), 0 (equal), or 1 (greater)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :dynamic :dynamic
        |&core-fn-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for fn") (:schema :dynamic)
          :code $ quote
            def &core-fn-impls $ [] &core-fn-methods internal/&core-show-impl
          :examples $ []
        |&core-fn-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-fn-methods $ &impl::new :&core-fn-methods
              :: :call $ defn &fn:call (f & args) (f & args)
              :: :call-args $ defn &fn:call-args (f args) (f & args)
              :: :map &fn:map
              :: :bind &fn:bind
              :: :mappend &fn:mappend
              :: :apply &fn:apply
          :examples $ []
        |&core-list-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for list\nNOTE: ordering matters; &core-list-methods must come before internal/&core-add-list-impl, otherwise list .add may be shadowed by Add trait :add.") (:schema :dynamic)
          :code $ quote
            def &core-list-impls $ [] &core-list-methods internal/&core-show-impl internal/&core-eq-impl internal/&core-add-list-impl internal/&core-len-list-impl internal/&core-mappable-list-impl
          :examples $ []
        |&core-list-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-list-methods $ &impl::new :&core-list-methods (:: :any? any?) (:: :add append) (:: :append append) (:: :assoc &list:assoc) (:: :assoc-after &list:assoc-after) (:: :assoc-before &list:assoc-before) (:: :bind mapcat) (:: :butlast butlast) (:: :concat &list:concat) (:: :contains? &list:contains?) (:: :includes? &list:includes?) (:: :count &list:count) (:: :drop drop) (:: :each each) (:: :empty &list:empty) (:: :empty? &list:empty?) (:: :filter &list:filter) (:: :filter-not filter-not) (:: :find find) (:: :find-index find-index) (:: :find-last &list:find-last) (:: :find-last-index &list:find-last-index) (:: :foldl foldl) (:: :get &list:nth) (:: :get-in get-in) (:: :group-by group-by) (:: :index-of index-of) (:: :join join) (:: :join-str join-str) (:: :last-index-of &list:last-index-of) (:: :map &list:map) (:: :map-indexed map-indexed) (:: :mappend &list:mappend) (:: :max &list:max) (:: :min &list:min) (:: :nth &list:nth) (:: :pairs-map pairs-map) (:: :prepend prepend) (:: :reduce reduce) (:: :reverse &list:reverse) (:: :slice &list:slice) (:: :sort sort) (:: :sort-by &list:sort-by) (:: :take take) (:: :take-last take-last) (:: :to-set &list:to-set) (:: :first &list:first) (:: :rest &list:rest) (:: :dissoc &list:dissoc) (:: :to-list identity) (:: :map-pair &list:map-pair) (:: :filter-pair &list:filter-pair) (:: :apply &list:apply) (:: :flatten &list:flatten)
          :examples $ []
        |&core-map-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for map") (:schema :dynamic)
          :code $ quote
            def &core-map-impls $ [] &core-map-methods internal/&core-show-impl internal/&core-eq-impl internal/&core-len-map-impl internal/&core-mappable-map-impl
          :examples $ []
        |&core-map-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-map-methods $ &impl::new :&core-map-methods (:: :add &map:add-entry) (:: :assoc &map:assoc) (:: :common-keys &map:common-keys) (:: :contains? &map:contains?) (:: :count &map:count) (:: :destruct &map:destruct) (:: :diff-keys &map:diff-keys) (:: :diff-new &map:diff-new) (:: :diff-triple &map:diff-triple) (:: :dissoc &map:dissoc) (:: :empty &map:empty) (:: :empty? &map:empty?) (:: :filter &map:filter) (:: :filter-kv &map:filter-kv) (:: :get &map:get) (:: :get-in get-in) (:: :includes? &map:includes?) (:: :keys keys) (:: :map &map:map) (:: :map-kv map-kv) (:: :map-list &map:map-list) (:: :mappend merge) (:: :merge merge) (:: :to-list &map:to-list) (:: :to-map identity) (:: :to-pairs to-pairs) (:: :values vals)
          :examples $ []
        |&core-number-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for number") (:schema :dynamic)
          :code $ quote
            def &core-number-impls $ [] &core-number-methods internal/&core-show-impl internal/&core-eq-impl internal/&core-add-number-impl internal/&core-multiply-number-impl
          :examples $ []
        |&core-number-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-number-methods $ &impl::new :&core-number-methods (:: :ceil ceil) (:: :empty &number:empty) (:: :floor floor) (:: :format &number:format) (:: :display-by &number:display-by) (:: :inc inc) (:: :pow pow) (:: :round round) (:: :round? round?) (:: :fract &number:fract) (:: :sqrt sqrt) (:: :negate negate) (:: :rem &number:rem)
          :examples $ []
        |&core-record-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for record") (:schema :dynamic)
          :code $ quote
            def &core-record-impls $ [] &core-record-methods internal/&core-show-impl internal/&core-eq-impl
          :examples $ []
        |&core-record-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-record-methods $ &impl::new :&core-record-methods (:: :count &record:count) (:: :contains? &record:contains?) (:: :get &record:get) (:: :nth &record:nth) (:: :assoc &record:assoc) (:: :to-map &record:to-map)
              :: :empty? $ defn &record:empty?-impl (x)
                &= 0 $ &record:count x
          :examples $ []
        |&core-set-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for set") (:schema :dynamic)
          :code $ quote
            def &core-set-impls $ [] &core-set-methods internal/&core-show-impl internal/&core-eq-impl internal/&core-len-set-impl
          :examples $ []
        |&core-set-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-set-methods $ &impl::new :&core-set-methods (:: :add include) (:: :contains? &set:includes?) (:: :count &set:count) (:: :destruct &set:destruct) (:: :difference difference) (:: :empty &set:empty) (:: :empty? &set:empty?) (:: :exclude exclude) (:: :filter &set:filter) (:: :include include) (:: :includes? &set:includes?) (:: :intersection intersection) (:: :mappend union) (:: :max &set:max) (:: :min &set:min) (:: :to-list &set:to-list) (:: :to-set identity) (:: :union union)
          :examples $ []
        |&core-string-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for string") (:schema :dynamic)
          :code $ quote
            def &core-string-impls $ [] &core-string-methods internal/&core-show-impl internal/&core-eq-impl internal/&core-add-string-impl internal/&core-len-string-impl
          :examples $ []
        |&core-string-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-string-methods $ &impl::new :&core-string-methods (:: :blank? blank?) (:: :count &str:count) (:: :empty &str:empty) (:: :ends-with? ends-with?) (:: :get &str:nth) (:: :parse-float parse-float) (:: :replace &str:replace) (:: :split split) (:: :split-lines split-lines) (:: :starts-with? starts-with?) (:: :strip-prefix strip-prefix) (:: :strip-suffix strip-suffix) (:: :slice &str:slice) (:: :trim trim) (:: :empty? &str:empty?) (:: :contains? &str:contains?) (:: :includes? &str:includes?) (:: :nth &str:nth) (:: :first &str:first) (:: :rest &str:rest) (:: :pad-left &str:pad-left) (:: :pad-right &str:pad-right) (:: :find-index &str:find-index) (:: :get-char-code get-char-code) (:: :escape &str:escape) (:: :mappend &str:concat)
          :examples $ []
        |&core-tuple-impls $ %{} :CodeEntry (:doc "|Built-in implementation list for tuple") (:schema :dynamic)
          :code $ quote
            def &core-tuple-impls $ [] &core-tuple-methods internal/&core-show-impl internal/&core-eq-impl
          :examples $ []
        |&core-tuple-methods $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            def &core-tuple-methods $ &impl::new :&core-tuple-methods (:: :count &tuple:count) (:: :nth &tuple:nth) (:: :get &tuple:nth) (:: :assoc &tuple:assoc)
              :: :first $ defn &tuple:first-impl (x) (&tuple:nth x 0)
              :: :empty? $ defn &tuple:empty?-impl (x)
                &= 0 $ &tuple:count x
              :: :contains? $ defn &tuple:contains?-impl (x k)
                if (&>= k 0)
                  &< k $ &tuple:count x
                  , false
          :examples $ []
        |&data-to-code $ %{} :CodeEntry (:doc "|internal function for converting data to code\nSyntax: (&data-to-code data)\nParams: data (EDN data)\nReturns: quoted code\nConverts EDN data structure back to executable code") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&difference $ %{} :CodeEntry (:doc "|internal function for set difference\nSyntax: (&difference set1 set2)\nParams: set1 (set), set2 (set)\nReturns: set\nReturns elements in set1 but not in set2")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T) (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :set 'T
        |&display-stack $ %{} :CodeEntry (:doc "|internal function for displaying call stack\nSyntax: (&display-stack)\nParams: none\nReturns: string representation of call stack\nReturns formatted string showing current call stack for debugging")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ []
        |&doseq $ %{} :CodeEntry (:doc "|Side-effect traversal macro. Iterates over a binding pair, executing the body for each element and returning nil.")
          :code $ quote
            defmacro &doseq (pair & body)
              if
                not $ and (list? pair)
                  &= 2 $ &list:count pair
                raise $ str-spaced "|doseq expects a pair, got:" pair
              let
                  name $ &list:first pair
                  xs0 $ last pair
                quasiquote $ foldl ~xs0 nil
                  defn doseq-fn% (_acc ~name) ~@body
          :examples $ []
            quote $ do
              defatom *seen $ []
              &doseq
                n $ [] 1 2
                reset! *seen $ append (deref *seen) n
              assert= ([] 1 2) (deref *seen)
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |&enum::new $ %{} :CodeEntry (:doc "|internal function for creating enum definitions\nSyntax: (&enum::new name (variant type...) ...)\nParams: name (tag), variant entries (list)\nReturns: enum prototype value\nCreates enum variants and payload type annotations") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ &enum::new :Result ([] :ok :number) ([] :err :string)
        |&enum:impl-traits $ %{} :CodeEntry (:doc "|internal function for enum trait impl attachment\nSyntax: (&enum:impl-traits enum impls)\nParams: enum (enum), impls (record)\nReturns: enum value with trait implementations\nAttaches impls info to an enum prototype") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&exclude $ %{} :CodeEntry (:doc "|internal function for excluding from set\nSyntax: (&exclude set element)\nParams: set (set), element (any)\nReturns: set\nReturns new set with element excluded")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T) 'T
              :generics $ [] 'T
              :return $ :: :set 'T
        |&extract-code-into-edn $ %{} :CodeEntry (:doc "|internal function for extracting code into EDN\nSyntax: (&extract-code-into-edn code)\nParams: code (quoted code)\nReturns: EDN data structure\nExtracts code structure into EDN format for serialization") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&fn:apply $ %{} :CodeEntry (:doc "|internal helper for fn :apply method entry")
          :code $ quote
            defn &fn:apply (f g)
              fn (x)
                g x $ f x
          :examples $ []
          :schema $ :: :fn
            {} (:return :fn)
              :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
              :generics $ [] 'A 'B 'C
        |&fn:bind $ %{} :CodeEntry (:doc "|internal helper for fn :bind method entry")
          :code $ quote
            defn &fn:bind (m f)
              fn (x)
                f (m x) x
          :examples $ []
          :schema $ :: :fn
            {} (:return :fn)
              :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
              :generics $ [] 'A 'B 'C
        |&fn:map $ %{} :CodeEntry (:doc "|internal helper for fn :map method entry")
          :code $ quote
            defn &fn:map (f g)
              fn (x)
                f $ g x
          :examples $ []
          :schema $ :: :fn
            {} (:return :fn)
              :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
                :: :fn $ {} (:return :dynamic)
                  :args $ []
              :generics $ [] 'A 'B 'C
        |&fn:mappend $ %{} :CodeEntry (:doc "|internal helper for fn :mappend method entry")
          :code $ quote
            defn &fn:mappend (f g)
              fn (x)
                &let
                  v1 $ f x
                  &let
                    v2 $ g x
                    if (list? v1) (&list:concat v1 v2)
                      if (map? v1) (merge v1 v2)
                        if (set? v1) (union v1 v2)
                          if (string? v1) (&str:concat v1 v2) (.mappend v1 v2)
          :examples $ []
          :schema $ :: :fn
            {} (:return :fn)
              :args $ []
                :: :fn $ {} (:return 'B)
                  :args $ [] 'A
                :: :fn $ {} (:return 'B)
                  :args $ [] 'A
              :generics $ [] 'A 'B
        |&format-ternary-tree $ %{} :CodeEntry (:doc "|internal function for formatting ternary tree\nSyntax: (&format-ternary-tree tree)\nParams: tree (ternary tree structure)\nReturns: formatted string\nFormats internal ternary tree data structure for debugging") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&get-calcit-backend $ %{} :CodeEntry (:doc "|internal function for getting Calcit backend\nSyntax: (&get-calcit-backend)\nParams: none\nReturns: keyword indicating backend\nReturns current backend like :cr (Calcit Runner) or :js (JavaScript)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ []
        |&get-calcit-running-mode $ %{} :CodeEntry (:doc "|internal function for getting Calcit running mode\nSyntax: (&get-calcit-running-mode)\nParams: none\nReturns: keyword indicating mode\nReturns current running mode like :dev, :release, or :test")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ []
        |&get-os $ %{} :CodeEntry (:doc "|internal function for getting OS information\nSyntax: (&get-os)\nParams: none\nReturns: keyword indicating OS\nReturns current operating system like :linux, :macos, :windows")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ []
        |&hash $ %{} :CodeEntry (:doc "|internal function for hashing\nSyntax: (&hash value)\nParams: value (any)\nReturns: number (hash code)\nComputes hash code for any Calcit value for use in hash tables")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :dynamic
        |&impl::new $ %{} :CodeEntry (:doc "|internal function for creating trait impl records\nSyntax: (&impl::new trait-or-name (method value) ...)\nParams: trait-or-name (trait/tag/symbol/string), method entries (pairs)\nReturns: impl\nAccepts method key as .method, :tag, symbol, or string") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ do
              deftrait DemoTrait $ .show :fn
              &impl::new DemoTrait $ :: .show
                fn (x) x
            quote $ &impl::new :DemoImpl
              [] :show $ fn (x) x
        |&impl:get $ %{} :CodeEntry (:doc "|internal function for getting impl entry by name\nSyntax: (&impl:get impl name)\nParams: impl (impl), name (tag/string/symbol/.method)\nReturns: any\nReturns impl entry value by method name")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ do
              deftrait DemoTrait $ .show :fn
              def DemoImpl $ &impl::new DemoTrait
                :: .show $ fn (x) x
              fn? $ &impl:get DemoImpl .show
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic
        |&impl:nth $ %{} :CodeEntry (:doc "|internal function for getting impl entry by index\nSyntax: (&impl:nth impl index)\nParams: impl (impl), index (number)\nReturns: any\nReturns impl entry value by index")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :number
        |&include $ %{} :CodeEntry (:doc "|internal function for including in set\nSyntax: (&include set element)\nParams: set (set), element (any)\nReturns: set\nReturns new set with element included")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T) 'T
              :generics $ [] 'T
              :return $ :: :set 'T
        |&init-builtin-impls! $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defn &init-builtin-impls! () (; "this function to make sure builtin impls are loaded") (identity &core-number-impls) (identity &core-string-impls) (identity &core-set-impls) (identity &core-list-impls) (identity &core-map-impls) (identity &core-fn-impls) (identity &core-tuple-impls) (identity &core-record-impls) (identity Add) (identity Eq) (identity Len) (identity Mappable) (identity Multiply) (identity Show)
              if
                &= (&get-calcit-backend) :js
                register-calcit-builtin-impls $ &js-object :number &core-number-impls :string &core-string-impls :set &core-set-impls :list &core-list-impls :map &core-map-impls :fn &core-fn-impls :tuple &core-tuple-impls :record &core-record-impls
                , nil
          :examples $ []
        |&let $ %{} :CodeEntry (:doc "|internal syntax for local binding (binds only 1 local)\nSyntax: (&let [binding value] body)\nParams: binding (symbol), value (any), body (expression)\nReturns: result of body with binding in scope\nCreates a local binding for a single variable") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= 6
              &let
                x $ + 1 2
                * x 2
            quote $ assert= |done
              &let (label |done) label
        |&list-match-internal $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro &list-match-internal (v branch1 pair branch2)
              quasiquote $ if (&list:empty? ~v)
                &let () ~@branch1
                &let
                    ~ $ first pair
                    &list:nth ~v 0
                  &let
                      ~ $ &list:nth pair 1
                      &list:slice ~v 1
                    &let () ~@branch2
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic :dynamic :dynamic)
        |&list:append $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:apply $ %{} :CodeEntry (:doc "|internal helper for list :apply method entry")
          :code $ quote
            defn &list:apply (xs fs)
              &list:concat & $ map fs
                fn (f)
                  map xs $ fn (x) (f x)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) (:: :list :fn)
              :generics $ [] 'T 'U
              :return $ :: :list 'U
        |&list:assoc $ %{} :CodeEntry (:doc "|internal function for list association\nSyntax: (&list:assoc list index element)\nParams: list (list), index (number), element (any)\nReturns: list\nReturns new list with element at specified index")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :number :tag
        |&list:assoc-after $ %{} :CodeEntry (:doc "|internal function for associating after element\nSyntax: (&list:assoc-after list target element)\nParams: list (list), target (any), element (any)\nReturns: list\nInserts element after first occurrence of target")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :number :tag
        |&list:assoc-before $ %{} :CodeEntry (:doc "|internal function for associating before element\nSyntax: (&list:assoc-before list target element)\nParams: list (list), target (any), element (any)\nReturns: list\nInserts element before first occurrence of target")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :number :tag
        |&list:butlast $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:concat $ %{} :CodeEntry (:doc "|internal function for concatenating lists\nSyntax: (&list:concat list1 list2)\nParams: list1 (list), list2 (list)\nReturns: list\nReturns new list with elements from both lists")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :list
        |&list:contains? $ %{} :CodeEntry (:doc "|internal function for checking if list contains element\nSyntax: (&list:contains? list element)\nParams: list (list), element (any)\nReturns: boolean\nReturns true if list contains element")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :list :number
        |&list:count $ %{} :CodeEntry (:doc "|internal function for counting list elements\nSyntax: (&list:count list)\nParams: list (list)\nReturns: number\nReturns number of elements in list")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :list
        |&list:dissoc $ %{} :CodeEntry (:doc "|internal function for list dissociation\nSyntax: (&list:dissoc list index)\nParams: list (list), index (number)\nReturns: list\nReturns new list without element at specified index")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :number
        |&list:distinct $ %{} :CodeEntry (:doc "|internal function for getting distinct list elements\nSyntax: (&list:distinct list)\nParams: list (list)\nReturns: list\nReturns new list with duplicate elements removed")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:empty $ %{} :CodeEntry (:doc "|internal helper for list :empty method entry")
          :code $ quote
            defn &list:empty (_xs) ([])
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:empty? $ %{} :CodeEntry (:doc "|internal function for checking if list is empty\nSyntax: (&list:empty? list)\nParams: list (list)\nReturns: boolean\nReturns true if list has no elements")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :list
        |&list:filter $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:filter (xs f)
              reduce xs ([])
                defn %&list:filter (acc x)
                  if (f x) (append acc x) acc
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:filter-pair $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:filter-pair (xs f)
              if (list? xs)
                &list:filter xs $ defn %filter-pair (pair)
                  assert "|expected a pair" $ and (list? pair)
                    = 2 $ count pair
                  f (nth pair 0) (nth pair 1)
                raise $ str-spaced "|expected list or map from `filter-pair`, got:" xs
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :dynamic :fn
        |&list:find-last $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:find-last (xs f)
              foldr-shortcut xs nil nil $ fn (_acc x)
                if (f x) (:: true x) (:: false nil)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :optional 'T
        |&list:find-last-index $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:find-last-index (xs f)
              foldr-shortcut xs
                dec $ count xs
                , nil $ fn (idx x)
                  if (f x) (:: true idx)
                    :: false $ &- 1 idx
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :optional :number
        |&list:first $ %{} :CodeEntry (:doc "|internal function for getting first list element\nSyntax: (&list:first list)\nParams: list (list)\nReturns: any or nil\nReturns first element of list, nil if empty")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :optional 'T
        |&list:flatten $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:flatten (xs)
              if (list? xs)
                &list:concat & $ map xs &list:flatten
                [] xs
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list
        |&list:foldl $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:foldl-shortcut $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:includes? $ %{} :CodeEntry (:doc "|internal function for checking if list includes element\nSyntax: (&list:includes? list element)\nParams: list (list), element (any)\nReturns: boolean\nReturns true if list includes element (alias for contains?)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] (:: :list 'T) 'T
              :generics $ [] 'T
        |&list:last $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:last-index-of $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:last-index-of (xs item)
              foldr-shortcut xs
                dec $ count xs
                , nil $ fn (idx x)
                  if (&= item x) (:: true idx)
                    :: false $ &- 1 idx
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) 'T
              :generics $ [] 'T
              :return $ :: :optional :number
        |&list:map $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:map (xs f)
              foldl xs ([])
                defn %&list:map (acc x)
                  append acc $ f x
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return 'U)
                  :args $ [] 'T
              :generics $ [] 'T 'U
              :return $ :: :list 'U
        |&list:map-pair $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:map-pair (xs f)
              if (list? xs)
                map xs $ defn %map-pair (pair)
                  assert "|expected a pair" $ and (list? pair)
                    = 2 $ count pair
                  f (nth pair 0) (nth pair 1)
                raise $ str-spaced "|expected list or map from `map-pair`, got:" xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] :dynamic :fn
              :generics $ [] 'U
              :return $ :: :list 'U
        |&list:mappend $ %{} :CodeEntry (:doc "|internal helper for list :mappend method entry")
          :code $ quote
            defn &list:mappend (x y) (&list:concat x y)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:max $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:max (xs)
              if (&list:empty? xs) nil $ &list:max-loop (&list:rest xs) (&list:first xs)
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :list
        |&list:max-loop $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:max-loop (xs acc)
              if (&list:empty? xs) acc $ &let
                x $ &list:first xs
                recur (&list:rest xs)
                  if (&> x acc) x acc
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :list :number
        |&list:min $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:min (xs)
              if (&list:empty? xs) nil $ &list:min-loop (&list:rest xs) (&list:first xs)
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :list
        |&list:min-loop $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:min-loop (xs acc)
              if (&list:empty? xs) acc $ &let
                x $ &list:first xs
                recur (&list:rest xs)
                  if (&< x acc) x acc
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :list :number
        |&list:nth $ %{} :CodeEntry (:doc "|internal function for getting nth list element\nSyntax: (&list:nth list index)\nParams: list (list), index (number)\nReturns: any or nil\nReturns element at index, nil if index out of bounds")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :list :number
        |&list:prepend $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:range $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:rest $ %{} :CodeEntry (:doc "|internal function for getting rest of list\nSyntax: (&list:rest list)\nParams: list (list)\nReturns: list\nReturns list without first element")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:reverse $ %{} :CodeEntry (:doc "|internal function for reversing lists\nSyntax: (&list:reverse list)\nParams: list (list)\nReturns: list\nReturns new list with elements in reverse order")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:slice $ %{} :CodeEntry (:doc "|internal function for slicing lists\nSyntax: (&list:slice list start end)\nParams: list (list), start (number), end (number)\nReturns: list\nReturns sublist from start to end index")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) :number :number
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:sort $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&list:sort-by $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &list:sort-by (xs f)
              if (tag? f)
                sort xs $ defn %&list:sort-by (a b)
                  &compare (get a f) (get b f)
                sort xs $ defn %&list:sort-by (a b)
                  &compare (f a) (f b)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) :dynamic
              :generics $ [] 'T
              :return $ :: :list 'T
        |&list:to-set $ %{} :CodeEntry (:doc "|internal function for converting list to set\nSyntax: (&list:to-set list)\nParams: list (list)\nReturns: set\nConverts list to set, removing duplicates")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :set)
              :args $ [] :list
        |&map:add-entry $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &map:add-entry (xs pair)
              assert "|&map:add-entry expected value in a pair" $ and (list? pair)
                &= 2 $ count pair
              &map:assoc xs (nth pair 0) (nth pair 1)
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :map :list
        |&map:assoc $ %{} :CodeEntry (:doc "|internal function for map association\nSyntax: (&map:assoc map key value & key-values)\nParams: map (map), key (any), value (any), key-values (any, variadic)\nReturns: map\nReturns new map with key-value associations")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V) 'K 'V
              :generics $ [] 'K 'V
              :return $ :: :map 'K 'V
        |&map:common-keys $ %{} :CodeEntry (:doc "|internal function for map common keys\nSyntax: (&map:common-keys map1 map2)\nParams: map1 (map), map2 (map)\nReturns: set\nReturns keys common to both maps")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :map :map
        |&map:contains? $ %{} :CodeEntry (:doc "|internal function for checking if map contains key\nSyntax: (&map:contains? map key)\nParams: map (map), key (any)\nReturns: boolean\nReturns true if map contains key")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] (:: :map 'K 'V) 'K
              :generics $ [] 'K 'V
        |&map:count $ %{} :CodeEntry (:doc "|internal function for counting map entries\nSyntax: (&map:count map)\nParams: map (map)\nReturns: number\nReturns number of key-value pairs in map")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :map
        |&map:destruct $ %{} :CodeEntry (:doc "|internal function for map destructuring\nSyntax: (&map:destruct map pattern)\nParams: map (map), pattern (any)\nReturns: map\nDestructs map according to pattern")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :map
        |&map:diff-keys $ %{} :CodeEntry (:doc "|internal function for map diff keys\nSyntax: (&map:diff-keys map1 map2)\nParams: map1 (map), map2 (map)\nReturns: set\nReturns keys that differ between maps")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :map :map
        |&map:diff-new $ %{} :CodeEntry (:doc "|internal function for map diff new\nSyntax: (&map:diff-new map1 map2)\nParams: map1 (map), map2 (map)\nReturns: map\nReturns new entries in map2 not in map1")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :map :map
        |&map:diff-triple $ %{} :CodeEntry (:doc "|Single-pass map diff returning [drop-keys new-diff common-triples].\nSyntax: (&map:diff-triple a b)\nParams: a (map), b (map)\nReturns: list\nReturns a list of three elements:\n  - drop-keys: set of keys in `a` but not in `b`\n  - new-diff: map of entries in `b` but not in `a`\n  - common-triples: list of [k va vb] for every key present in both maps\n\nMore efficient than calling &map:diff-keys, &map:diff-new, and &map:common-keys separately,\nas it only traverses both maps twice instead of 3+ times.")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                triple $ &map:diff-triple (&{} :a 1 :b 2) (&{} :a 2 :c 3)
              [] (nth triple 0) (nth triple 1) (count (nth triple 2))
            quote $ let
                triple $ &map:diff-triple (&{} :x 10 :y 20) (&{} :x 10 :y 99 :z 30)
                drop-keys $ nth triple 0
                new-diff $ nth triple 1
                common-triples $ nth triple 2
              list drop-keys new-diff common-triples
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :map :map
        |&map:dissoc $ %{} :CodeEntry (:doc "|internal function for map dissociation\nSyntax: (&map:dissoc map key & keys)\nParams: map (map), key (any), keys (any, variadic)\nReturns: map\nReturns new map without specified keys")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V) 'K
              :generics $ [] 'K 'V
              :return $ :: :map 'K 'V
        |&map:empty $ %{} :CodeEntry (:doc "|internal helper for producing an empty map value while preserving method signature shape")
          :code $ quote
            defn &map:empty (_xs) (&{})
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :map
        |&map:empty? $ %{} :CodeEntry (:doc "|internal function for checking if map is empty\nSyntax: (&map:empty? map)\nParams: map (map)\nReturns: boolean\nReturns true if map has no entries")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :map
        |&map:filter $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &map:filter (xs f)
              reduce xs (&{})
                defn %&map:filter (acc x)
                  hint-fn $ {}
                    :args $ [] (:: :map 'K 'V) ('P)
                    :return $ :: :map 'K 'V
                  if (f x)
                    &map:assoc acc (nth x 0) (nth x 1)
                    , acc
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'P
              :generics $ [] 'K 'V 'P
              :return $ :: :map 'K 'V
        |&map:filter-kv $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &map:filter-kv (xs f)
              reduce xs (&{})
                defn %map:filter-kv (acc x)
                  hint-fn $ {}
                    :args $ [] (:: :map 'K 'V) ('P)
                    :return $ :: :map 'K 'V
                  if
                    f (nth x 0) (nth x 1)
                    &map:assoc acc (nth x 0) (nth x 1)
                    , acc
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'K 'V
              :generics $ [] 'K 'V
              :return $ :: :map 'K 'V
        |&map:get $ %{} :CodeEntry (:doc "|internal function for getting map value\nSyntax: (&map:get map key) or (&map:get map key default)\nParams: map (map), key (any), default (any, optional)\nReturns: any\nGets value for key, returns default if key not found")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V) 'K
              :generics $ [] 'K 'V
              :return $ :: :optional 'V
        |&map:includes? $ %{} :CodeEntry (:doc "|internal function for checking if map includes key\nSyntax: (&map:includes? map key)\nParams: map (map), key (any)\nReturns: boolean\nReturns true if map includes key (alias for contains?)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] (:: :map 'K 'V) 'K
              :generics $ [] 'K 'V
        |&map:keys $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&map:map $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &map:map (xs f)
              foldl xs ({})
                defn &map:map (acc pair)
                  hint-fn $ {}
                    :args $ [] (:: :map 'R 'S) ('P)
                    :return $ :: :map 'R 'S
                  &let
                    result $ f pair
                    assert "|expected pair returned when mapping hashmap" $ and (list? result)
                      &= 2 $ &list:count result
                    &map:assoc acc (nth result 0) (nth result 1)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V)
                :: :fn $ {} (:return 'Q)
                  :args $ [] 'P
              :generics $ [] 'K 'V 'P 'Q 'R 'S
              :return $ :: :map 'R 'S
        |&map:map-list $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &map:map-list (xs f)
              if (map? xs)
                foldl xs ([])
                  defn %&map:map-list (acc pair)
                    hint-fn $ {}
                      :args $ [] (:: :list 'U) ('P)
                      :return $ :: :list 'U
                    append acc $ f pair
                raise $ str-spaced "|&map:map-list expected a map, got:" xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V)
                :: :fn $ {} (:return 'U)
                  :args $ [] 'P
              :generics $ [] 'K 'V 'P 'U
              :return $ :: :list 'U
        |&map:to-list $ %{} :CodeEntry (:doc "|internal function for converting map to list\nSyntax: (&map:to-list map)\nParams: map (map)\nReturns: list\nConverts map to list of [key value] pairs")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :map
        |&map:vals $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote (&runtime-implementation)
          :examples $ []
        |&max $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &max (a b)
              assert "|expects numbers for &max" $ if (number? a) (number? b)
              if (&> a b) a b
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&merge $ %{} :CodeEntry (:doc "|internal function for merging maps\nSyntax: (&merge map1 map2 & maps)\nParams: map1 (map), map2 (map), maps (map, variadic)\nReturns: map\nMerges multiple maps, later values override earlier ones")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :map :map
        |&merge-non-nil $ %{} :CodeEntry (:doc "|internal function for merging non-nil values\nSyntax: (&merge-non-nil map1 map2 & maps)\nParams: map1 (map), map2 (map), maps (map, variadic)\nReturns: map\nMerges maps, skipping nil values")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :map :map
        |&min $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &min (a b)
              assert "|expects numbers for &min" $ if (number? a) (number? b)
              if (&< a b) a b
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |&number:display-by $ %{} :CodeEntry (:doc "|internal function for number display by base\nSyntax: (&number:display-by n base)\nParams: n (number), base (integer)\nReturns: string\nDisplays number in specified base (2-36)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :number :number
        |&number:empty $ %{} :CodeEntry (:doc "|internal helper for number :empty method entry")
          :code $ quote
            defn &number:empty (_x) 0
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |&number:format $ %{} :CodeEntry (:doc "|internal function for number formatting\nSyntax: (&number:format n)\nParams: n (number)\nReturns: string\nFormats number as string representation")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :number
        |&number:fract $ %{} :CodeEntry (:doc "|internal function for number fractional part\nSyntax: (&number:fract n)\nParams: n (number)\nReturns: number\nReturns fractional part of number (n - floor(n))") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&number:rem $ %{} :CodeEntry (:doc "|internal function for number remainder\nSyntax: (&number:rem a b)\nParams: a (number), b (number)\nReturns: number\nReturns remainder of a divided by b") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record-match-internal $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro &record-match-internal (value & body)
              if (&list:empty? body)
                quasiquote $ eprintln "|[Warn] record-match found no matched case, missing `_` case?" ~value
                &let
                  pair $ &list:nth body 0
                  if
                    not $ list? pair
                    raise $ str-spaced "|record-match expected arm in list, got:" pair
                  let
                      pattern $ &list:nth pair 0
                    assert "|expected record or symbol as pattern" $ or (record? pattern) (symbol? pattern)
                    if (&= pattern '_)
                      &let ()
                        assert "|record-match expected a branch after `_`" $ &<= 3 (&list:count pair)
                        quasiquote $ &let
                            ~ $ &list:nth pair 1
                            , ~value
                          ~@ $ &list:slice pair 2
                      &let ()
                        assert "|record-match expected an with (proto new-name & body)" $ &<= 3 (&list:count pair)
                        quasiquote $ if (&record:matches? ~value ~pattern)
                          &let
                              ~ $ &list:nth pair 1
                              , ~value
                            ~@ $ &list:slice pair 2
                          &record-match-internal ~value $ ~@ (&list:rest body)
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |&record:assoc $ %{} :CodeEntry (:doc "|internal function for record field association\nSyntax: (&record:assoc record key value & key-values)\nParams: record (record), key (any), value (any), key-values (any, variadic)\nReturns: record\nReturns new record with field associations") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:contains? $ %{} :CodeEntry (:doc "|internal function for checking if record contains field\nSyntax: (&record:contains? record key)\nParams: record (record), key (any)\nReturns: boolean\nReturns true if record contains field") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:count $ %{} :CodeEntry (:doc "|internal function for counting record fields\nSyntax: (&record:count record)\nParams: record (record)\nReturns: number\nReturns number of fields in record")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :tag
        |&record:extend-as $ %{} :CodeEntry (:doc "|internal function for extending record as new type\nSyntax: (&record:extend-as record new-name)\nParams: record (record), new-name (keyword)\nReturns: record\nExtends record as new type with different name") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:from-map $ %{} :CodeEntry (:doc "|internal function for creating record from map\nSyntax: (&record:from-map name map)\nParams: name (keyword), map (map)\nReturns: record\nCreates record from map with specified name") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:get $ %{} :CodeEntry (:doc "|internal function for getting record field\nSyntax: (&record:get record key) or (&record:get record key default)\nParams: record (record), key (any), default (any, optional)\nReturns: any\nGets field value, returns default if field not found")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tag :tag
        |&record:get-name $ %{} :CodeEntry (:doc "|internal function for getting record name\nSyntax: (&record:get-name record)\nParams: record (record)\nReturns: keyword\nReturns name of record")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tag
        |&record:impl-traits $ %{} :CodeEntry (:doc "|internal function for record trait impl attachment\nSyntax: (&record:impl-traits record impls)\nParams: record (record), impls (any)\nReturns: record\nReturns new record with specified impls") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:impls $ %{} :CodeEntry (:doc "|internal function for getting record impls\nSyntax: (&record:impls record)\nParams: record (record)\nReturns: any\nReturns impls of record") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:matches? $ %{} :CodeEntry (:doc "|internal function for checking record matches\nSyntax: (&record:matches? record pattern)\nParams: record (record), pattern (any)\nReturns: boolean\nReturns true if record matches pattern") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&record:struct $ %{} :CodeEntry (:doc "|internal function for getting record source struct\nSyntax: (&record:struct record)\nParams: record (record)\nReturns: struct or nil\nReturns source struct definition of record, or nil when unavailable") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ let
                User $ defstruct User (:name :string)
                u $ %{} User (:name |Alice)
              assert= User $ &record:struct u
        |&record:to-map $ %{} :CodeEntry (:doc "|internal function for converting record to map\nSyntax: (&record:to-map record)\nParams: record (record)\nReturns: map\nConverts record to map")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :tag
        |&record:with $ %{} :CodeEntry (:doc "|internal function for record with operation\nSyntax: (&record:with record key value & key-values)\nParams: record (record), key (any), value (any), key-values (any, variadic)\nReturns: record\nReturns new record with updated fields") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&reset-gensym-index! $ %{} :CodeEntry (:doc "|internal function for resetting gensym index\nSyntax: (&reset-gensym-index!)\nParams: none\nReturns: nil\nResets the global gensym counter to 0 for deterministic symbol generation") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&set:count $ %{} :CodeEntry (:doc "|internal function for counting set elements\nSyntax: (&set:count set)\nParams: set (set)\nReturns: number\nReturns number of elements in set")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :set
        |&set:destruct $ %{} :CodeEntry (:doc "|internal function for set destructuring\nSyntax: (&set:destruct set pattern)\nParams: set (set), pattern (any)\nReturns: set\nDestructs set according to pattern")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :set
        |&set:empty $ %{} :CodeEntry (:doc "|internal helper for set :empty method entry")
          :code $ quote
            defn &set:empty (_xs) (#{})
          :examples $ []
          :schema $ :: :fn
            {} (:return :set)
              :args $ [] :set
        |&set:empty? $ %{} :CodeEntry (:doc "|internal function for checking if set is empty\nSyntax: (&set:empty? set)\nParams: set (set)\nReturns: boolean\nReturns true if set has no elements")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :set
        |&set:filter $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &set:filter (xs f)
              reduce xs (#{})
                defn %&set:filter (acc x)
                  hint-fn $ {}
                    :args $ [] (:: :set 'T) ('T)
                    :return $ :: :set 'T
                  if (f x) (&include acc x) acc
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :set 'T
        |&set:includes? $ %{} :CodeEntry (:doc "|internal function for checking if set includes element\nSyntax: (&set:includes? set element)\nParams: set (set), element (any)\nReturns: boolean\nReturns true if set includes element")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] (:: :set 'T) 'T
              :generics $ [] 'T
        |&set:intersection $ %{} :CodeEntry (:doc "|internal function for set intersection\nSyntax: (&set:intersection set1 set2)\nParams: set1 (set), set2 (set)\nReturns: set\nReturns elements common to both sets")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T) (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :set 'T
        |&set:max $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &set:max (xs)
              &list:max $ &set:to-list xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :optional 'T
        |&set:min $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn &set:min (xs)
              &list:min $ &set:to-list xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :optional 'T
        |&set:to-list $ %{} :CodeEntry (:doc "|internal function for converting set to list\nSyntax: (&set:to-list set)\nParams: set (set)\nReturns: list\nConverts set to list of elements")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |&str $ %{} :CodeEntry (:doc "|internal function for string conversion\nSyntax: (&str value)\nParams: value (any)\nReturns: string\nConverts value to string representation") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&str-spaced $ %{} :CodeEntry (:doc "|Internal function for joining strings with spaces, used by str-spaced")
          :code $ quote
            defn &str-spaced (head? x0 & xs)
              if (&list:empty? xs)
                if head? (&str x0)
                  if (nil? x0) | $ &str:concat "| " x0
                if (some? x0)
                  &str:concat
                    if head? (&str x0) (&str:concat "| " x0)
                    &str-spaced false & xs
                  &str-spaced head? & xs
          :examples $ []
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :string)
              :args $ [] :bool :dynamic
        |&str:compare $ %{} :CodeEntry (:doc "|internal function for string comparison\nSyntax: (&str:compare a b)\nParams: a (string), b (string)\nReturns: number\nCompares strings lexicographically, returns -1, 0, or 1")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :string :string
        |&str:concat $ %{} :CodeEntry (:doc "|internal function for string concatenation\nSyntax: (&str:concat a b)\nParams: a (string), b (string)\nReturns: string\nConcatenates two strings together")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :string
        |&str:contains? $ %{} :CodeEntry (:doc "|internal function for checking if string contains substring\nSyntax: (&str:contains? s substring)\nParams: s (string), substring (string)\nReturns: boolean\nReturns true if string contains substring")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string :string
        |&str:count $ %{} :CodeEntry (:doc "|internal function for string character count\nSyntax: (&str:count s)\nParams: s (string)\nReturns: number\nReturns number of characters in string")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :string
        |&str:empty $ %{} :CodeEntry (:doc "|internal helper for string :empty method entry")
          :code $ quote
            defn &str:empty (_) |
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |&str:empty? $ %{} :CodeEntry (:doc "|internal function for checking if string is empty\nSyntax: (&str:empty? s)\nParams: s (string)\nReturns: boolean\nReturns true if string has zero length")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string
        |&str:escape $ %{} :CodeEntry (:doc "|internal function for string escaping\nSyntax: (&str:escape s)\nParams: s (string)\nReturns: string\nEscapes special characters in string for safe output")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |&str:find-index $ %{} :CodeEntry (:doc "|internal function for finding string index\nSyntax: (&str:find-index s pattern)\nParams: s (string), pattern (string)\nReturns: number or nil\nFinds first index of pattern in string, returns nil if not found")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :string :dynamic
        |&str:first $ %{} :CodeEntry (:doc "|internal function for getting first character\nSyntax: (&str:first s)\nParams: s (string)\nReturns: string or nil\nReturns first character of string, nil if empty")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |&str:includes? $ %{} :CodeEntry (:doc "|internal function for checking if string includes substring\nSyntax: (&str:includes? s substring)\nParams: s (string), substring (string)\nReturns: boolean\nReturns true if string includes substring (alias for contains?)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string :string
        |&str:nth $ %{} :CodeEntry (:doc "|internal function for getting nth character\nSyntax: (&str:nth s index)\nParams: s (string), index (number)\nReturns: string or nil\nReturns character at index, nil if index out of bounds")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :number
        |&str:pad-left $ %{} :CodeEntry (:doc "|internal function for left padding string\nSyntax: (&str:pad-left s length pad-char)\nParams: s (string), length (number), pad-char (string)\nReturns: string\nPads string on left to specified length with pad character")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :number :string
        |&str:pad-right $ %{} :CodeEntry (:doc "|internal function for right padding string\nSyntax: (&str:pad-right s length pad-char)\nParams: s (string), length (number), pad-char (string)\nReturns: string\nPads string on right to specified length with pad character")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :number :string
        |&str:replace $ %{} :CodeEntry (:doc "|internal function for string replacement\nSyntax: (&str:replace s pattern replacement)\nParams: s (string), pattern (string), replacement (string)\nReturns: string\nReplaces all occurrences of pattern with replacement")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :string :string
        |&str:rest $ %{} :CodeEntry (:doc "|internal function for getting rest of string\nSyntax: (&str:rest s)\nParams: s (string)\nReturns: string\nReturns string without first character")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |&str:slice $ %{} :CodeEntry (:doc "|internal function for string slicing\nSyntax: (&str:slice s start end)\nParams: s (string), start (number), end (number)\nReturns: string\nExtracts substring from start to end index")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :number :number
        |&struct::new $ %{} :CodeEntry (:doc "|internal function for creating struct definitions\nSyntax: (&struct::new name (field type) ...)\nParams: name (tag), field pairs (list)\nReturns: struct definition value\nCreates a struct definition with fields and type annotations") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ &struct::new :Person ([] :name :string) ([] :age :number)
        |&struct:impl-traits $ %{} :CodeEntry (:doc "|internal function for struct trait impl attachment\nSyntax: (&struct:impl-traits struct impls)\nParams: struct (struct), impls (record)\nReturns: struct with trait implementations\nAttaches impls info to a struct definition") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&trait::new $ %{} :CodeEntry (:doc "|internal function for creating trait values\nSyntax: (&trait::new name methods)\nParams: name (tag/symbol), methods (list of tags)\nReturns: trait\nCreates a trait definition value") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&tuple:assoc $ %{} :CodeEntry (:doc "|internal function for tuple assoc operation\nSyntax: (&tuple:assoc tuple index value)\nParams: tuple (tuple), index (number), value (any)\nReturns: new tuple with updated value\nReturns new tuple with value at index updated")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :tuple :number :tag
        |&tuple:count $ %{} :CodeEntry (:doc "|internal function for tuple count operation\nSyntax: (&tuple:count tuple)\nParams: tuple (tuple)\nReturns: number of elements\nReturns the number of elements in the tuple")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :tuple
        |&tuple:enum $ %{} :CodeEntry (:doc "|Get the enum prototype from a tuple\nSyntax: (&tuple:enum tuple)\nParams: tuple (tuple)\nReturns: enum value or nil if not an enum tuple")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tuple
        |&tuple:enum-has-variant? $ %{} :CodeEntry (:doc "|Check if an enum has a specific variant\nSyntax: (&tuple:enum-has-variant? enum tag)\nParams: enum (enum), tag (tag)\nReturns: bool - true if variant exists") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&tuple:enum-variant-arity $ %{} :CodeEntry (:doc "|Get the arity of a variant in an enum\nSyntax: (&tuple:enum-variant-arity enum tag)\nParams: enum (enum), tag (tag)\nReturns: number - number of payload fields for the variant") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&tuple:impl-traits $ %{} :CodeEntry (:doc "|internal function for tuple trait impl attachment\nSyntax: (&tuple:impl-traits tuple new-impls)\nParams: tuple (tuple), new-impls (any)\nReturns: new tuple with updated impls\nReturns new tuple with same values but different impls") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&tuple:impls $ %{} :CodeEntry (:doc "|internal function for getting tuple impls\nSyntax: (&tuple:impls tuple)\nParams: tuple (tuple)\nReturns: impls of the tuple\nReturns the impls/type identifier of the tuple") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&tuple:nth $ %{} :CodeEntry (:doc "|internal function for tuple nth operation\nSyntax: (&tuple:nth tuple index)\nParams: tuple (tuple), index (number)\nReturns: value at index or nil\nGets the value at specified index in tuple, returns nil if out of bounds")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :tuple :number
        |&tuple:params $ %{} :CodeEntry (:doc "|internal function for getting tuple params\nSyntax: (&tuple:params tuple)\nParams: tuple (tuple)\nReturns: list of parameter values\nReturns the parameter values of the tuple as a list")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :tuple
        |&tuple:validate-enum $ %{} :CodeEntry (:doc "|Validate enum tuple tag/arity if enum metadata exists\nSyntax: (&tuple:validate-enum tuple tag)\nParams: tuple (tuple), tag (tag)\nReturns: nil\nRaises error on invalid tag or arity") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |&union $ %{} :CodeEntry (:doc "|internal function for set union\nSyntax: (&union set1 set2 & sets)\nParams: set1 (set), set2 (set), sets (set, variadic)\nReturns: set\nReturns union of all sets")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :set 'T) (:: :set 'T)
              :generics $ [] 'T
              :return $ :: :set 'T
        |&{} $ %{} :CodeEntry (:doc "|internal function for creating maps\nSyntax: (&{} & key-value-pairs)\nParams: key-value-pairs (any, variadic)\nReturns: map\nCreates new map from key-value pairs") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |' $ %{} :CodeEntry (:doc "|alias for []") (:schema :dynamic)
          :code $ quote (def ' [])
          :examples $ []
        |* $ %{} :CodeEntry (:doc "|Multiply numbers together")
          :code $ quote
            defn * (x & ys) (reduce ys x &*)
          :examples $ []
            quote $ assert= 6 (* 2 3)
            quote $ assert= 24 (* 2 3 4)
            quote $ assert= 2 (* 2)
            quote $ assert= 24 (* 2 3 4)
            quote $ assert= 30 (* 5 6)
            quote $ assert= 1 (* 1)
          :schema $ :: :fn
            {} (:rest :number) (:return :number)
              :args $ [] :number
        |+ $ %{} :CodeEntry (:doc "|Mathematical addition operation\\nFunction: Calculates the sum of one or more numbers\\nParams: x (number), ys (variadic args, list of numbers)\\nReturns: number - sum of all arguments\\nNotes: Supports any number of arguments, requires at least one argument")
          :code $ quote
            defn + (x & ys) (reduce ys x &+)
          :examples $ []
            quote $ quote
              assert= 6 $ + 1 2 3
            quote $ quote
              assert= 15 $ + 5 10
          :schema $ :: :fn
            {} (:rest :number) (:return :number)
              :args $ [] :number
        |- $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn - (x & ys)
              if (&list:empty? ys) (&- 0 x) (reduce ys x &-)
          :examples $ []
            quote $ assert= 5 (- 10 3 2)
            quote $ assert= -5 (- 5)
          :schema $ :: :fn
            {} (:rest :number) (:return :number)
              :args $ [] :number
        |-> $ %{} :CodeEntry (:doc "|Thread-first macro\nSyntax: (-> value step1 step2 ...)\nEvaluates the value through each step by inserting it as the first argument and returns the final result.")
          :code $ quote
            defmacro -> (base & xs)
              if (&list:empty? xs) (quasiquote ~base)
                &let
                  x0 $ &list:first xs
                  if
                    and (list? x0) (&list:empty? x0)
                    raise "|-> expects non-empty list step"
                  if
                    and
                      not $ list? x0
                      not $ thread-step? x0
                    raise $ str-spaced "|-> expects symbol/tag/fn/method or list step, got:" x0
                  if (list? x0)
                    recur
                      &list:concat
                        [] (&list:first x0) base
                        &list:rest x0
                      , & $ &list:rest xs
                    recur ([] x0 base) & $ &list:rest xs
          :examples $ []
            quote $ assert= 3 (-> 1 inc inc)
            quote $ assert= 9
              -> 2 inc $ * 3
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |->% $ %{} :CodeEntry (:doc "|pass value as `%` into several expressions")
          :code $ quote
            defmacro ->% (base & xs)
              if (&list:empty? xs) base $ let
                  tail $ last xs
                  pairs $ &list:concat
                    [] $ [] '% base
                    map (butlast xs)
                      defn %->% (x) ([] '% x)
                quasiquote $ let ~pairs ~tail
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |->> $ %{} :CodeEntry (:doc "|thread macro passing value at end of each expression")
          :code $ quote
            defmacro ->> (base & xs)
              if (&list:empty? xs) (quasiquote ~base)
                &let
                  x0 $ &list:first xs
                  if
                    and (list? x0) (&list:empty? x0)
                    raise "|->> expects non-empty list step"
                  if
                    and
                      not $ list? x0
                      not $ thread-step? x0
                    raise $ str-spaced "|->> expects symbol/tag/fn/method or list step, got:" x0
                  if (list? x0)
                    &call-spread recur (append x0 base) & $ &list:rest xs
                    &call-spread recur ([] x0 base) & $ &list:rest xs
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |/ $ %{} :CodeEntry (:doc |dividing)
          :code $ quote
            defn / (x & ys)
              if (&list:empty? ys) (&/ 1 x) (reduce ys x &/)
          :examples $ []
            quote $ / 12 3 2
            quote $ / 8
          :schema $ :: :fn
            {} (:rest :number) (:return :number)
              :args $ [] :number
        |/= $ %{} :CodeEntry (:doc "|not equal")
          :code $ quote
            defn /= (a b) (not= a b)
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |: $ %{} :CodeEntry (:doc "|Macro sugar for tagged tuples\nExpands to `::` while passing the tag through `turn-tag`, so both keywords and bare symbols may be used.")
          :code $ quote
            defmacro : (tag & args)
              if
                not $ or (tag? tag) (symbol? tag) (string? tag)
                raise $ str-spaced "|: expects tag/symbol/string for tag, got:" tag
              quasiquote $ ::
                ~ $ turn-tag tag
                ~@ args
          :examples $ []
            quote $ assert= (:: :point 1 2) (: :point 1 2)
            quote $ assert= (:: :name |calcit) (: |name |calcit)
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |:: $ %{} :CodeEntry (:doc "|internal function for creating tuples\nSyntax: (:: impls & values)\nParams: impls (any), values (any, variable number)\nReturns: tuple with impls and values\nCreates a tuple with specified impls and values") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |;nil $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro ;nil (& _body) nil
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([])
        |< $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn < (x & ys)
              if
                &= 1 $ &list:count ys
                &< x $ &list:first ys
                foldl-compare ys x &<
          :examples $ []
          :schema $ :: :fn
            {} (:rest :number) (:return :bool)
              :args $ [] :number
        |<- $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defmacro <- (& xs)
              if (&list:empty? xs) (raise "|<- expects at least 1 expression")
              quasiquote $ ->
                ~@ $ reverse xs
          :examples $ []
        |<= $ %{} :CodeEntry (:doc "|Less than or equal comparison, supports multiple arguments")
          :code $ quote
            defn <= (x & ys)
              if
                &= 1 $ &list:count ys
                &<= x $ &list:first ys
                foldl-compare ys x &<=
          :examples $ []
            quote $ assert= true (<= 3 5)
            quote $ assert= true (<= 3 3)
            quote $ assert= true (<= 1 2 3 4)
          :schema $ :: :fn
            {} (:rest :number) (:return :bool)
              :args $ [] :number
        |= $ %{} :CodeEntry (:doc "|Equality predicate for one or more values\nReturns true only when every provided argument is equal, short-circuiting on the first mismatch.")
          :code $ quote
            defn = (x & ys)
              if
                &= 1 $ &list:count ys
                &= x $ &list:first ys
                foldl-compare ys x &=
          :examples $ []
            quote $ assert= true (= 3 3 3)
            quote $ assert= false (= 1 2)
            quote $ assert= true
              = ([] 1 2) ([] 1 2)
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :bool)
              :args $ [] :dynamic
        |> $ %{} :CodeEntry (:doc "|Greater-than comparison for one or more numbers\nReturns true only when the value strictly decreases across every argument.")
          :code $ quote
            defn > (x & ys)
              if
                &= 1 $ &list:count ys
                &> x $ &list:first ys
                foldl-compare ys x &>
          :examples $ []
            quote $ assert= true (> 5 3)
            quote $ assert= false (> 3 5)
            quote $ assert= true (> 8 4 2 1)
            quote $ assert= false (> 2 2)
          :schema $ :: :fn
            {} (:rest :number) (:return :bool)
              :args $ [] :number
        |>= $ %{} :CodeEntry (:doc "|Greater-than-or-equal comparison for one or more numbers")
          :code $ quote
            defn >= (x & ys)
              if
                &= 1 $ &list:count ys
                &>= x $ &list:first ys
                foldl-compare ys x &>=
          :examples $ []
            quote $ assert= true (>= 5 3)
            quote $ assert= true (>= 5 5)
            quote $ assert= false (>= 3 5)
          :schema $ :: :fn
            {} (:rest :number) (:return :bool)
              :args $ [] :number
        |? $ %{} :CodeEntry (:doc "|internal syntax for optional argument in function definition\nSyntax: (? optional-arg) in parameter list\nParams: optional-arg (symbol)\nReturns: parameter marker\nMarks optional parameters in function definitions") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |Add $ %{} :CodeEntry (:doc "|Core trait: Add") (:schema :dynamic)
          :code $ quote
            deftrait Add $ .add
              :: :fn $ {} (:return 'T)
                :generics $ [] 'T
                :args $ [] 'T 'T
          :examples $ []
        |Contains $ %{} :CodeEntry (:doc "|Core trait: Contains") (:schema :dynamic)
          :code $ quote
            deftrait Contains $ .contains?
              :: :fn $ {} (:return :bool)
                :generics $ [] 'T
                :args $ [] 'T :dynamic
          :examples $ []
        |Countable $ %{} :CodeEntry (:doc "|Core trait: Countable") (:schema :dynamic)
          :code $ quote
            deftrait Countable $ .count
              :: :fn $ {} (:return :number)
                :generics $ [] 'T
                :args $ [] 'T
          :examples $ []
        |Deserialize $ %{} :CodeEntry (:doc "|Core trait: Deserialize") (:schema :dynamic)
          :code $ quote
            deftrait Deserialize $ .deserialize
              :: :fn $ {} (:return 'T)
                :generics $ [] 'T
                :args $ [] :string
          :examples $ []
        |Eq $ %{} :CodeEntry (:doc "|Core trait: Eq") (:schema :dynamic)
          :code $ quote
            deftrait Eq $ .eq?
              :: :fn $ {} (:return :bool)
                :generics $ [] 'T
                :args $ [] 'T 'T
          :examples $ []
        |Len $ %{} :CodeEntry (:doc "|Core trait: Len") (:schema :dynamic)
          :code $ quote
            deftrait Len $ .len
              :: :fn $ {} (:return :number)
                :generics $ [] 'T
                :args $ [] 'T
          :examples $ []
        |Mappable $ %{} :CodeEntry (:doc "|Core trait: Mappable") (:schema :dynamic)
          :code $ quote
            deftrait Mappable $ .map
              :: :fn $ {} (:return 'T)
                :generics $ [] 'T
                :args $ [] 'T :fn
          :examples $ []
        |Multiply $ %{} :CodeEntry (:doc "|Core trait: Multiply") (:schema :dynamic)
          :code $ quote
            deftrait Multiply $ .multiply
              :: :fn $ {} (:return 'T)
                :generics $ [] 'T
                :args $ [] 'T 'T
          :examples $ []
        |Option $ %{} :CodeEntry (:doc "|Rust-style Option enum") (:schema :dynamic)
          :code $ quote
            def Option $ impl-traits
              defenum Option (:some :dynamic) (:none)
              , internal/&core-show-impl internal/&core-eq-impl OptionMappableImpl
          :examples $ []
        |OptionMappableImpl $ %{} :CodeEntry (:doc "|Trait impl for Mappable on Option") (:schema :dynamic)
          :code $ quote
            defimpl OptionMappableImpl Mappable $ .map option:map
          :examples $ []
        |Result $ %{} :CodeEntry (:doc "|Rust-style Result enum") (:schema :dynamic)
          :code $ quote
            def Result $ impl-traits
              defenum Result (:ok :dynamic) (:err :dynamic)
              , internal/&core-show-impl internal/&core-eq-impl ResultMappableImpl
          :examples $ []
        |ResultMappableImpl $ %{} :CodeEntry (:doc "|Trait impl for Mappable on Result") (:schema :dynamic)
          :code $ quote
            defimpl ResultMappableImpl Mappable $ .map result:map
          :examples $ []
        |Serialize $ %{} :CodeEntry (:doc "|Core trait: Serialize") (:schema :dynamic)
          :code $ quote
            deftrait Serialize $ .serialize
              :: :fn $ {} (:return :string)
                :generics $ [] 'T
                :args $ [] 'T
          :examples $ []
        |Show $ %{} :CodeEntry (:doc "|Core trait: Show") (:schema :dynamic)
          :code $ quote
            deftrait Show $ .show
              :: :fn $ {} (:return :string)
                :generics $ [] 'T
                :args $ [] 'T
          :examples $ []
        |[,] $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro [,] (& body)
              &let
                xs $ &list:filter body
                  fn (x) (/= x ',)
                quasiquote $ [] ~@xs
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([])
        |[] $ %{} :CodeEntry (:doc "|internal function for creating lists\nSyntax: ([] & elements)\nParams: elements (any, variadic)\nReturns: list\nCreates new list from provided elements") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |[][] $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro [][] (& xs)
              if
                not $ and (list? xs) (every? xs list?)
                raise $ str-spaced "|[][] expects list items, got:" xs
              &let
                items $ map xs
                  fn (ys)
                    quasiquote $ [] ~@ys
                quasiquote $ [] ~@items
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([])
        |\ $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro \ (& xs)
              if (&list:empty? xs) (raise "|\\ expects function body")
              quasiquote $ defn %\ (? % %2) ~xs
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([])
        |\. $ %{} :CodeEntry (:doc "|this syntax is bared used, deprecating")
          :code $ quote
            defmacro \. (args-alias & xs)
              if
                not $ or (symbol? args-alias) (string? args-alias)
                raise $ str-spaced "|\\. expects symbol/string arg alias, got:" args-alias
              if (&list:empty? xs) (raise "|\\. expects function body")
              &let
                args $ ->% (turn-string args-alias) (split % |,) (map % turn-symbol)
                &let
                  inner-body $ if
                    &= 1 $ &list:count xs
                    &list:first xs
                    quasiquote $ &let () ~@xs
                  apply-args (inner-body args)
                    fn (body ys)
                      if (&list:empty? ys) (quasiquote ~body)
                        &let
                          a0 $ last ys
                          &let
                            code $ [] (quasiquote defn)
                              turn-symbol $ &str:concat |f_ (turn-string a0)
                              [] a0
                              , body
                            recur code $ butlast ys
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |abs $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn abs (x)
              if (&< x 0) (&- 0 x) x
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |add-watch $ %{} :CodeEntry (:doc "|internal function for adding atom watchers\nSyntax: (add-watch atom key callback)\nParams: atom (atom), key (any), callback (function)\nReturns: atom\nAdds watcher function to atom")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :unit)
              :args $ [] :ref :dynamic :fn
        |and $ %{} :CodeEntry (:doc "|Logical conjunction macro with short-circuit semantics\nReturns the first falsy value or the last truthy value, evaluating expressions left to right.") (:schema :dynamic)
          :code $ quote
            defmacro and (& xs)
              if (&list:empty? xs) (raise "|and expects at least 1 expression")
              &let
                item $ &list:first xs
                &let
                  rest-xs $ &list:rest xs
                  if (&list:empty? rest-xs)
                    if (list? item)
                      &let
                        v1# $ gensym |v1
                        quasiquote $ &let (~v1# ~item) (if ~v1# ~v1# false)
                      quasiquote $ if ~item ~item false
                    quasiquote $ if ~item
                      and
                        ~ $ &list:first rest-xs
                        ~@ $ &list:rest rest-xs
                      , false
          :examples $ []
            quote $ assert= false (and true false true)
            quote $ assert= |done (and true |done)
        |any? $ %{} :CodeEntry (:doc "|checks if any element in collection satisfies the predicate function, returns true on first match, short-circuits evaluation")
          :code $ quote
            defn any? (xs f)
              foldl-shortcut xs false false $ defn %any? (acc x)
                if (f x) (:: true true) (:: false acc)
          :examples $ []
            quote $ assert= true
              any? ([] 1 2 3 4) even?
            quote $ assert= false
              any? ([] 1 3 5 7) even?
            quote $ assert= false
              any? ([]) even?
            quote $ assert= false
              any? ([] 1 2 3)
                fn (x) (> x 10)
            quote $ assert= true
              any? ([] 5 15 25)
                fn (x) (> x 10)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :fn
        |append $ %{} :CodeEntry (:doc "|internal function for appending to list\nSyntax: (append list element)\nParams: list (list), element (any)\nReturns: list\nReturns new list with element added at end")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :dynamic
        |apply $ %{} :CodeEntry (:doc "|calls a function with arguments from a list, spreads the list as individual arguments")
          :code $ quote
            defn apply (f args) (f & args)
          :examples $ []
            quote $ assert= 6
              apply + $ [] 1 2 3
            quote $ assert= 10
              apply * $ [] 2 5
            quote $ assert= |abc
              apply str $ [] |a |b |c
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :fn :list
        |apply-args $ %{} :CodeEntry (:doc "|macro that applies a function to arguments, handles empty argument list specially")
          :code $ quote
            defmacro apply-args (args f)
              if
                not $ list? args
                raise $ str-spaced "|apply-args expects list args, got:" args
              if
                &= [] $ &list:first args
                quasiquote $ ~f
                  ~@ $ &list:rest args
                quasiquote $ ~f ~@args
          :examples $ []
            quote $ assert= 6
              apply-args ([] 1 2 3) +
            quote $ assert= 15
              apply-args ([] 5 10) +
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |assert $ %{} :CodeEntry (:doc "|asserts that an expression is truthy, raises an error with message if not")
          :code $ quote
            defmacro assert (message xs)
              if
                if (string? xs)
                  not $ string? message
                  , false
                quasiquote $ assert ~xs ~message
                quasiquote $ &let ()
                  if
                    not $ string? ~message
                    raise $ str-spaced "|expects 1st argument to be string, got:" ~message
                  if ~xs nil $ &let ()
                    eprintln "|Failed assertion:" $ format-to-lisp (quote ~xs)
                    raise $ ~
                      &str:concat (&str:concat message "| ") (format-to-lisp xs)
          :examples $ []
            quote $ assert "|x should be positive" (> 1 0)
            quote $ assert "|list should not be empty"
              not $ empty? ([] 1)
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |assert-detect $ %{} :CodeEntry (:doc "|asserts that a value satisfies a predicate function, raises error with details if not")
          :code $ quote
            defmacro assert-detect (f code)
              &let
                v $ gensym |v
                quasiquote $ &let (~v ~code)
                  if (~f ~v) nil $ &let () (eprintln)
                    eprintln
                      format-to-lisp $ quote ~code
                      , "|does not satisfy:"
                        format-to-lisp $ quote ~f
                        , "| <--------"
                    eprintln "|  value is:" ~v
                    raise "|Not satisfied in assertion!"
          :examples $ []
            quote $ assert-detect number? (+ 1 2)
            quote $ assert-detect list? ([] 1 2 3)
            quote $ assert-detect even? (* 2 5)
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |assert-type $ %{} :CodeEntry (:doc "|internal syntax for type assertion at preprocessing stage\nSyntax: (assert-type expr type-expr)\nParams: expr (any), type-expr (type annotation)\nReturns: evaluated result of expr\nAsserts that expr matches the given type annotation during static analysis") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |assert= $ %{} :CodeEntry (:doc "|asserts that two values are equal, raises error showing both values if not")
          :code $ quote
            defmacro assert= (a b)
              &let
                va $ gensym |va
                &let
                  vb $ gensym |vb
                  quasiquote $ &let (~va ~a)
                    &let (~vb ~b)
                      if (not= ~va ~vb)
                        &let () (eprintln) (eprintln "|Left: " ~va)
                          eprintln "|      " $ format-to-lisp (quote ~a)
                          eprintln |Right: ~vb
                          eprintln "|      " $ format-to-lisp (quote ~b)
                          raise "|not equal in assertion!"
          :examples $ []
            quote $ assert= 4 (+ 2 2)
            quote $ assert= |hello (str |hel |lo)
            quote $ assert= ([] 1 2 3) (range 1 4)
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |assoc $ %{} :CodeEntry (:doc "|associates a key-value pair to a collection, works on maps, lists, tuples, and records")
          :code $ quote
            defn assoc (x k v)
              if (nil? x)
                raise $ str-spaced "|assoc does not work on nil for:" k v
                if (list? x) (&list:assoc x k v) (.assoc x k v)
          :examples $ []
            quote $ assert= (&{} :a 1 :b 2)
              assoc (&{} :a 1) :b 2
            quote $ assert= ([] 10 2 3)
              assoc ([] 1 2 3) 0 10
            quote $ assert= (&{} :a 1 :b 3)
              assoc (&{} :a 1 :b 2) :b 3
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :dynamic
        |assoc-in $ %{} :CodeEntry (:doc "|associates a value at a nested path in a data structure, creates intermediate maps if needed")
          :code $ quote
            defn assoc-in (data path v)
              list-match path
                () v
                (p0 ps)
                  &let
                    d $ either data (&{})
                    assoc d p0 $ assoc-in
                      if (contains? d p0) (get d p0) (&{})
                      , ps v
          :examples $ []
            quote $ assert=
              &{} :a $ &{} :b 1
              assoc-in (&{}) ([] :a :b) 1
            quote $ assert=
              &{} :a $ &{} :b 2
              assoc-in
                &{} :a $ &{} :b 1
                [] :a :b
                , 2
            quote $ assert=
              &{} :x $ &{} :y (&{} :z 3)
              assoc-in (&{}) ([] :x :y :z) 3
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :list :dynamic
        |atom $ %{} :CodeEntry (:doc "|internal function for creating atoms\nSyntax: (atom value)\nParams: value (any)\nReturns: atom\nCreates new atom with initial value")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :ref)
              :args $ [] :dynamic
        |bit-and $ %{} :CodeEntry (:doc "|internal function for bitwise AND\nSyntax: (bit-and a b)\nParams: a (integer), b (integer)\nReturns: integer\nPerforms bitwise AND operation on two integers")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |bit-not $ %{} :CodeEntry (:doc "|internal function for bitwise NOT\nSyntax: (bit-not n)\nParams: n (integer)\nReturns: integer\nPerforms bitwise NOT operation (complement) on integer")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |bit-or $ %{} :CodeEntry (:doc "|internal function for bitwise OR\nSyntax: (bit-or a b)\nParams: a (integer), b (integer)\nReturns: integer\nPerforms bitwise OR operation on two integers")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |bit-shl $ %{} :CodeEntry (:doc "|internal function for bit shift left\nSyntax: (bit-shl n shift)\nParams: n (integer), shift (integer)\nReturns: integer\nShifts bits of n left by shift positions")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |bit-shr $ %{} :CodeEntry (:doc "|internal function for bit shift right\nSyntax: (bit-shr n shift)\nParams: n (integer), shift (integer)\nReturns: integer\nShifts bits of n right by shift positions")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |bit-xor $ %{} :CodeEntry (:doc "|internal function for bitwise XOR\nSyntax: (bit-xor a b)\nParams: a (integer), b (integer)\nReturns: integer\nPerforms bitwise XOR operation on two integers")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |blank? $ %{} :CodeEntry (:doc "|internal function for checking if string is blank\nSyntax: (blank? s)\nParams: s (string)\nReturns: boolean\nReturns true if string is empty or contains only whitespace")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string
        |bool? $ %{} :CodeEntry (:doc |)
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |buffer? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn buffer? (x)
              &= (type-of x) :buffer
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |butlast $ %{} :CodeEntry (:doc "|internal function for getting all but last element\nSyntax: (butlast list)\nParams: list (list)\nReturns: list\nReturns new list without the last element")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list
        |call-w-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro call-w-log (f & xs)
              if
                not $ or (symbol? f) (list? f)
                raise $ str-spaced "|call-w-log expects function expression, got:" f
              let
                  v $ if
                    = :eval $ &get-calcit-running-mode
                    gensym |v
                    , '_log_tmp
                  args-value $ gensym |args-value
                quasiquote $ let
                    ~args-value $ [] ~@xs
                    ~v $ ~f & ~args-value
                  println |call:
                    format-to-lisp $ quote (call-w-log ~f ~@xs)
                    , |=> ~v
                  println "|f:   " ~f
                  println |args: ~args-value
                  ~ v
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |call-wo-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro call-wo-log (f & xs)
              if
                not $ or (symbol? f) (list? f)
                raise $ str-spaced "|call-wo-log expects function expression, got:" f
              quasiquote $ ~f ~@xs
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |case $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro case (item & patterns)
              if (&list:empty? patterns) (raise "|case expects at least 1 pattern")
              if
                not $ and (list? patterns) (every? patterns list?)
                raise $ str-spaced "|case expects pattern pairs in list, got:" patterns
              if
                not $ every? patterns
                  fn (pair)
                    &= 2 $ &list:count pair
                raise $ str-spaced "|case expects each pattern as pair, got:" patterns
              &let
                v $ gensym |v
                quasiquote $ &let (~v ~item) (&case ~v nil ~@patterns)
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |case-default $ %{} :CodeEntry (:doc "|Case macro variant with an explicit default branch\nEvaluates the target once, compares it against pattern/result pairs, and falls back to the provided default when no pattern matches.")
          :code $ quote
            defmacro case-default (item default & patterns)
              if (&list:empty? patterns)
                raise $ str-spaced "|Expected patterns for case-default, got empty after:" default
              if
                not $ and (list? patterns) (every? patterns list?)
                raise $ str-spaced "|case-default expects pattern pairs in list, got:" patterns
              if
                not $ every? patterns
                  fn (pair)
                    &= 2 $ &list:count pair
                raise $ str-spaced "|case-default expects each pattern as pair, got:" patterns
              &let
                v $ gensym |v
                quasiquote $ &let (~v ~item) (&case ~v ~default ~@patterns)
          :examples $ []
            quote $ assert= |two
              case-default 2 |none (1 |one) (2 |two)
            quote $ assert= |none
              case-default 3 |none $ 1 |one
            quote $ assert= |fallback
              case-default 5 |fallback (1 |one) (2 |two) (3 |three)
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |ceil $ %{} :CodeEntry (:doc "|internal function for ceiling operation\nSyntax: (ceil n)\nParams: n (number)\nReturns: number\nReturns smallest integer greater than or equal to n")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |char-from-code $ %{} :CodeEntry (:doc "|internal function for creating character from code\nSyntax: (char-from-code code)\nParams: code (number)\nReturns: string\nCreates character from Unicode code point")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :number
        |cirru-quote? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn cirru-quote? (x)
              &= (type-of x) :cirru-quote
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |concat $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn concat (& args)
              list-match args
                () $ []
                (a0 as) (&list:concat a0 & as)
          :examples $ []
            quote $ assert= ([] 1 2 3 4 5)
              concat ([] 1 2) ([] 3 4) ([] 5)
          :schema $ :: :fn
            {}
              :args $ []
              :generics $ [] 'T
              :rest $ :: :list 'T
              :return $ :: :list 'T
        |cond $ %{} :CodeEntry (:doc "|Multi-branch conditional macro. Evaluates condition/result pairs in order and returns the first truthy branch; use `true` as a default guard.") (:schema :dynamic)
          :code $ quote
            defmacro cond (& pairs)
              if (&list:empty? pairs) (raise "|cond expects at least 1 (condition branch) pair")
              &let
                pair $ &list:first pairs
                if
                  not $ and (list? pair)
                    &= 2 $ &list:count pair
                  raise $ str-spaced "|cond expects a pair, got:" pair
                &let
                  else $ &list:rest pairs
                  &let
                    expr $ &list:nth pair 0
                    &let
                      branch $ &list:nth pair 1
                      if
                        if (empty? else) (= true expr) false
                        , branch $ quasiquote
                          if ~expr ~branch $ ~
                            if (&list:empty? else) nil $ quasiquote (cond ~@else)
          :examples $ []
            quote $ assert= :small
              cond
                  &< 2 1
                  , :nope
                (&< 2 5) :small
                true :fallback
            quote $ assert= :fallback
              cond (false :branch) (true :fallback)
        |conj $ %{} :CodeEntry (:doc "|Appends values to the end of a list, returning a new list\nSupports adding multiple values by chaining additional arguments.")
          :code $ quote
            defn conj (xs y0 & ys)
              if (empty? ys) (append xs y0)
                recur (append xs y0) & ys
          :examples $ []
            quote $ assert= ([] 1 2 3)
              conj ([] 1 2) 3
            quote $ assert= ([] 1 2 3 4)
              conj ([] 1) 2 3 4
          :schema $ :: :fn
            {} (:rest 'T)
              :args $ [] (:: :list 'T) 'T
              :generics $ [] 'T
              :return $ :: :list 'T
        |contains-in? $ %{} :CodeEntry (:doc "|Checks whether a nested path exists within maps, records, tuples, or lists. Returns true only when every hop succeeds.")
          :code $ quote
            defn contains-in? (xs path)
              list-match path
                () true
                (p0 ps)
                  cond
                      list? xs
                      if
                        and (number? p0) (&list:contains? xs p0)
                        recur (nth xs p0) ps
                        , false
                    (map? xs)
                      if (&map:contains? xs p0)
                        recur (&map:get xs p0) ps
                        , false
                    (record? xs)
                      if (&record:contains? xs p0)
                        recur (&record:get xs p0) ps
                        , false
                    (tuple? xs)
                      if
                        and (&>= p0 0)
                          &< p0 $ &tuple:count xs
                        recur (&tuple:nth xs p0) ps
                        , false
                    true false
          :examples $ []
            quote $ assert= true
              contains-in?
                {} $ :profile
                  {} $ :name |calcit
                [] :profile :name
            quote $ assert= false
              contains-in?
                {} $ :profile
                  {} $ :name |calcit
                [] :profile :missing
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :list
        |contains-symbol? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn contains-symbol? (xs y)
              if (list? xs)
                apply-args (xs)
                  defn %contains-symbol? (body)
                    list-match body
                      () false
                      (b0 bs)
                        if (contains-symbol? b0 y) true $ recur bs
                &= xs y
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |contains? $ %{} :CodeEntry (:doc "|Checks whether a collection contains a key or index at the current level. Supports lists, tuples, maps, and records while treating nil as false.")
          :code $ quote
            defn contains? (x k)
              if (nil? x) false $ if (list? x) (&list:contains? x k) (.contains? x k)
          :examples $ []
            quote $ assert= true
              contains? ([] :a :b) 1
            quote $ assert= true
              contains?
                {} $ :a 1
                , :a
            quote $ assert= false (contains? nil :missing)
            quote $ assert= true
              contains? (#{} 1 2 3) 2
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |cos $ %{} :CodeEntry (:doc "|internal function for cosine\nSyntax: (cos n)\nParams: n (number, radians)\nReturns: number\nReturns cosine of angle in radians")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |count $ %{} :CodeEntry (:doc "|Counts elements in a collection or string\nNil input returns 0; otherwise delegates to the underlying data structure's counter.")
          :code $ quote
            defn count (x)
              if (nil? x) 0 $ if (list? x) (&list:count x) (.count x)
          :examples $ []
            quote $ assert= 4
              count $ [] 1 2 3 4
            quote $ assert= 5 (count |hello)
            quote $ assert= 0 (count nil)
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :dynamic
        |cpu-time $ %{} :CodeEntry (:doc "|internal function for getting CPU time\nSyntax: (cpu-time)\nParams: none\nReturns: number\nReturns current CPU time in milliseconds for performance measurement")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ []
        |dec $ %{} :CodeEntry (:doc "|Decrements a number by 1")
          :code $ quote
            defn dec (x) (&- x 1)
          :examples $ []
            quote $ assert= 4 (dec 5)
            quote $ assert= -1 (dec 0)
            quote $ assert= -4 (dec -3)
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |def $ %{} :CodeEntry (:doc "|special macro to expose value to definition")
          :code $ quote
            defmacro def (_name x) x
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |defatom $ %{} :CodeEntry (:doc "|internal syntax for defining referenced state\nSyntax: (defatom name initial-value)\nParams: name (symbol), initial-value (any)\nReturns: atom definition\nDefines a mutable reference with initial value")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ ; defatom *my-atom
              {} $ :a 1
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic
        |defenum $ %{} :CodeEntry (:doc "|macro for defining enums\nSyntax: (defenum Name :variant type... ...)\nParams: Name (symbol/tag), variants (tag + payload types)\nReturns: enum prototype value\nExpands to &enum::new")
          :code $ quote
            defmacro defenum (name & variants)
              assert "|defenum expects name as tag/symbol" $ or (tag? name) (symbol? name)
              assert "|defenum expects variants in list" $ and (list? variants) (every? variants list?)
              assert "|defenum expects (variant & payloads)" $ every? variants
                fn (variant)
                  &let
                    items $ if
                      &= [] $ &list:first variant
                      &list:rest variant
                      , variant
                    &>= (count items) 1
              &let
                normalized $ map variants
                  fn (variant)
                    &let
                      items $ if
                        &= [] $ &list:first variant
                        &list:rest variant
                        , variant
                      &let
                        variant-tag $ &list:first items
                        &let
                          payload-forms $ map (&list:rest items)
                            fn (t)
                              if (list? t)
                                quasiquote $ quote (~ t)
                                , t
                          quasiquote $ [] (~ variant-tag) (~@ payload-forms)
                quasiquote $ &enum::new
                  ~ $ turn-tag name
                  ~@ normalized
          :examples $ []
            quote $ defenum Result (:ok :number) (:err :string)
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |defimpl $ %{} :CodeEntry (:doc "|macro for defining trait impl values\nSyntax: (defimpl ImplName Trait (.method value) ...), (defimpl ImplName Trait (:: .method value) ...), or legacy (defimpl ImplName Trait :method value ...)\nParams: ImplName (symbol/tag), Trait (symbol/tag), method pairs\nReturns: impl value\nNotes: this macro does not attach impl to a target type/value; use `impl-traits` separately\nExpands to &impl::new")
          :code $ quote
            defmacro defimpl (name trait & pairs)
              if
                not $ or (tag? name) (symbol? name)
                raise $ str-spaced "|defimpl misuse. Expected: first argument is impl name (symbol/tag). Actual:" name "|Fix: rewrite as (defimpl ImplName Trait ...)."
              if
                not $ or (tag? trait) (symbol? trait)
                raise $ str-spaced "|defimpl misuse. Expected: second argument is trait (symbol/tag). Actual:" trait "|Fix: rewrite as (defimpl ImplName Trait ...)."
              quasiquote $ def ~name
                &impl::new
                  ~ $ if (tag? trait) (turn-tag trait) trait
                  ~@ $ if (every? pairs list?)
                    do
                      assert "|defimpl expects method pairs" $ and (list? pairs) (every? pairs list?)
                      assert "|defimpl expects (:method value) pairs" $ every? pairs
                        fn (pair)
                          &let
                            items $ if
                              &= [] $ &list:first pair
                              &list:rest pair
                              if
                                &= (quote ::) (&list:first pair)
                                &list:rest pair
                                , pair
                            and
                              &= 2 $ count items
                              or
                                tag? $ &list:first items
                                &= :method $ type-of (&list:first items)
                      map pairs $ fn (pair)
                        &let
                          items $ if
                            &= [] $ &list:first pair
                            &list:rest pair
                            if
                              &= (quote ::) (&list:first pair)
                              &list:rest pair
                              , pair
                          do
                            assert "|defimpl expects (:method value) pairs" $ &= 2 (count items)
                            let
                                k0 $ &list:first items
                                v0 $ &list:nth items 1
                                key $ if (tag? k0) k0
                                  if
                                    &= :method $ type-of k0
                                    let
                                        s $ format-to-lisp k0
                                      turn-tag $ &str:slice s 9
                                        &- (count s) 1
                                    raise $ str-spaced "|defimpl expects method key as :tag or .method, got:" k0
                              quasiquote $ [] ~key ~v0
                    do
                      assert "|defimpl expects even number of items" $ &= 0
                        &number:rem (count pairs) 2
                      map (section-by pairs 2)
                        fn (pair)
                          &let
                            items $ if
                              &= [] $ &list:first pair
                              &list:rest pair
                              if
                                &= (quote ::) (&list:first pair)
                                &list:rest pair
                                , pair
                            do
                              assert "|defimpl expects (:method value) pairs" $ &= 2 (count items)
                              let
                                  k0 $ &list:first items
                                  v0 $ &list:nth items 1
                                  key $ if (tag? k0) k0
                                    if
                                      &= :method $ type-of k0
                                      let
                                          s $ format-to-lisp k0
                                        turn-tag $ &str:slice s 9
                                          &- (count s) 1
                                      raise $ str-spaced "|defimpl expects method key as :tag or .method, got:" k0
                                quasiquote $ [] ~key ~v0
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |defmacro $ %{} :CodeEntry (:doc "|internal syntax for defining macros\nSyntax: (defmacro name [args] body)\nParams: name (symbol), args (list of symbols), body (expression)\nReturns: macro definition\nDefines a macro that transforms code at compile time")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ do
              defmacro identity-macro (x) (quasiquote ~x)
              assert= 4 $ identity-macro (+ 2 2)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :dynamic
        |defn $ %{} :CodeEntry (:doc "|internal syntax for defining functions\nSyntax: (defn name [args] body)\nParams: name (symbol), args (list of symbols), body (expression)\nReturns: function definition\nDefines a named function with parameters and body expression")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ defn my-add (p1 p2) (+ p1 p2)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :dynamic
        |defn-w-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro defn-w-log (f-name args & body)
              if
                not $ symbol? f-name
                raise $ str-spaced "|defn-w-log expects function name symbol, got:" f-name
              if
                not $ list? args
                raise $ str-spaced "|defn-w-log expects args in list, got:" args
              if (&list:empty? body) (raise "|defn-w-log expects function body")
              quasiquote $ defn ~f-name ~args
                &let
                  ~f-name $ defn ~f-name ~args ~@body
                  call-w-log ~f-name ~@args
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |defn-wo-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro defn-wo-log (f-name args & body)
              if
                not $ symbol? f-name
                raise $ str-spaced "|defn-wo-log expects function name symbol, got:" f-name
              if
                not $ list? args
                raise $ str-spaced "|defn-wo-log expects args in list, got:" args
              if (&list:empty? body) (raise "|defn-wo-log expects function body")
              quasiquote $ defn ~f-name ~args ~@body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |defstruct $ %{} :CodeEntry (:doc "|macro for defining record structs\nSyntax: (defstruct Name [('T 'S)] :field :type ...)\nParams: Name (symbol/tag), optional generics list, field pairs (tag + type)\nReturns: struct definition value\nExpands to &struct::new")
          :code $ quote
            defmacro defstruct (name & pairs)
              assert "|defstruct expects name as tag/symbol" $ or (tag? name) (symbol? name)
              assert "|defstruct expects pairs in list" $ and (list? pairs) (every? pairs list?)
              &let
                first-pair $ if (empty? pairs) nil (&list:first pairs)
                &let
                  generics $ if (list? first-pair)
                    if
                      and
                        not $ empty? first-pair
                        not $ tag? (&list:first first-pair)
                      , first-pair $ []
                    , []
                  &let
                    field-pairs $ if (empty? generics) pairs (&list:rest pairs)
                    assert "|defstruct expects (field type) pairs" $ every? field-pairs
                      fn (pair)
                        &let
                          items $ if
                            &= [] $ &list:first pair
                            &list:rest pair
                            , pair
                          &= 2 $ count items
                    &let
                      normalized $ map field-pairs
                        fn (pair)
                          &let
                            items $ if
                              &= [] $ &list:first pair
                              &list:rest pair
                              , pair
                            &let
                              field-name $ &list:first items
                              &let
                                type-form $ last items
                                if (list? type-form)
                                  quasiquote $ [] (~ field-name)
                                    quote $ ~ type-form
                                  quasiquote $ [] (~ field-name) (~ type-form)
                      if (empty? generics)
                        quasiquote $ &struct::new
                          ~ $ turn-tag name
                          ~@ normalized
                        quasiquote $ &struct::new
                          ~ $ turn-tag name
                          ~ $ &list:concat ([]) generics
                          ~@ normalized
          :examples $ []
            quote $ defstruct Person (:name :string) (:age :number)
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |deftrait $ %{} :CodeEntry (:doc "|macro for defining traits\nSyntax: (deftrait Name (.method (:: :fn $ {} (:args [...]) (:return t))) ...)\nParams: Name (symbol/tag), methods (list of (tag type))\nNotes: use :fn (tag) for DynFn when signature is intentionally omitted\nReturns: trait definition value\nExpands to &trait::new")
          :code $ quote
            defmacro deftrait (name & methods)
              assert "|deftrait expects (method type) pairs" $ every? methods list?
              &let
                normalized $ map methods
                  fn (entry)
                    &let
                      items $ if
                        &= [] $ &list:first entry
                        &list:rest entry
                        , entry
                      do
                        assert "|deftrait expects (method type) pairs" $ &= 2 (count items)
                        let
                            m0 $ &list:first items
                            t0 $ &list:nth items 1
                            k0 $ if (tag? m0) m0
                              if
                                &= :method $ type-of m0
                                let
                                    s $ format-to-lisp m0
                                  turn-tag $ &str:slice s 9
                                    &- (count s) 1
                                raise $ str-spaced "|deftrait expects method key as :tag or .method, got:" m0
                            t1 $ internal/normalize-trait-type t0
                          quasiquote $ [] ~k0 (quote ~t1)
                quasiquote $ def ~name
                  &trait::new
                    ~ $ turn-tag name
                    [] ~@normalized
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |deref $ %{} :CodeEntry (:doc "|Reads the current value stored in a reference\nSupports Calcit atoms as well as other host structures that implement deref.")
          :code $ quote
            defn deref (*a)
              if (ref? *a) (&atom:deref *a) (.deref *a)
          :examples $ []
            quote $ do (defatom *state 1)
              assert= 1 $ deref *state
            quote $ do (defatom *counter 0) (reset! *counter 5)
              assert= 5 $ deref *counter
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |destruct-list $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn destruct-list (xs)
              if (empty? xs) (:: :none)
                :: :some (nth xs 0) (&list:slice xs 1)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :list
        |destruct-map $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn destruct-map (xs)
              &let
                pair $ &map:destruct xs
                if (nil? pair) (:: :none) (:: :some & pair)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :map
        |destruct-set $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn destruct-set (xs)
              &let
                pair $ &set:destruct xs
                if (nil? pair) (:: :none)
                  :: :some (nth pair 0) (nth pair 1)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :set
        |destruct-str $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn destruct-str (s)
              if (&= s |) (:: :none)
                :: :some (nth s 0) (&str:slice s 1)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :string
        |difference $ %{} :CodeEntry (:doc "|Returns the set difference of base and all other sets")
          :code $ quote
            defn difference (base & xs)
              reduce xs base $ fn (acc item) (&difference acc item)
          :examples $ []
            quote $ assert= (#{} 1)
              difference (#{} 1 2 3) (#{} 2 3 4)
            quote $ assert= (#{} 1 2)
              difference (#{} 1 2 3 4) (#{} 3 4 5)
          :schema $ :: :fn
            {} (:rest :set) (:return :set)
              :args $ [] :set
        |dissoc $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn dissoc (x & args)
              if (nil? x) nil $ if (list? x) (&list:dissoc x & args)
                if (map? x) (&map:dissoc x & args) (.dissoc x & args)
          :examples $ []
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :dynamic)
              :args $ [] :dynamic
        |dissoc-in $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn dissoc-in (data path)
              list-match path
                () nil
                (p0 ps)
                  if
                    &= 1 $ &list:count path
                    dissoc data p0
                    assoc data p0 $ dissoc-in (get data p0) ps
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :list
        |distinct $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn distinct (x) (&list:distinct x)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |do $ %{} :CodeEntry (:doc "|Evaluates expressions sequentially and returns the last result\nUseful for grouping side effects or multiple steps where only the final value matters.") (:schema :dynamic)
          :code $ quote
            defmacro do (& body)
              ; println |body: $ format-to-lisp body
              if (empty? body) (raise "|empty do is not okay")
              quasiquote $ &let () (~@ body)
          :examples $ []
            quote $ assert= 3
              do (inc 1) (+ 1 2)
            quote $ assert= |world
              do (str |hello) (str |world)
        |drop $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn drop (xs n)
              slice xs n $ &list:count xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) :number
              :generics $ [] 'T
              :return $ :: :list 'T
        |each $ %{} :CodeEntry (:doc "|Iterate over a collection and apply function f for side effects, returns nil")
          :code $ quote
            defn each (xs f)
              foldl xs nil $ defn %each (_acc x) (f x)
          :examples $ []
            quote $ assert= nil
              each ([] 1 2 3)
                fn (x) (&+ x 1)
          :schema $ :: :fn
            {} (:return :unit)
              :args $ [] :dynamic
                :: :fn $ {} (:return :dynamic)
                  :args $ [] 'T
              :generics $ [] 'T
        |either $ %{} :CodeEntry (:doc "|Returns the first non-nil value among its arguments\nBehaves like a nil-coalescing macro: only nil triggers evaluation of subsequent branches, so false is preserved as a value.") (:schema :dynamic)
          :code $ quote
            defmacro either (& xs)
              if (&list:empty? xs) (raise "|either expects at least 1 expression")
              &let
                item $ &list:first xs
                &let
                  rest-xs $ &list:rest xs
                  if (&list:empty? rest-xs) item $ if (list? item)
                    &let
                      v1# $ gensym |v1
                      quasiquote $ &let (~v1# ~item)
                        if (nil? ~v1#)
                          either
                            ~ $ &list:first rest-xs
                            ~@ $ &list:rest rest-xs
                          ~ v1#
                    quasiquote $ if (nil? ~item)
                      either
                        ~ $ &list:first rest-xs
                        ~@ $ &list:rest rest-xs
                      ~ item
          :examples $ []
            quote $ assert= 42 (either nil 42 nil)
            quote $ assert= false (either false true)
            quote $ assert= |backup (either nil nil |backup)
        |empty $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn empty (x)
              if (nil? x) nil $ if (list? x) ([]) (.empty x)
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |empty? $ %{} :CodeEntry (:doc "|Checks whether a collection or string is empty\nNil values are considered empty, otherwise delegates to the underlying data structure.")
          :code $ quote
            defn empty? (x)
              if (nil? x) true $ if (list? x) (&list:empty? x) (.empty? x)
          :examples $ []
            quote $ assert= true
              empty? $ []
            quote $ assert= false
              empty? $ [] 1
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |ends-with? $ %{} :CodeEntry (:doc "|internal function for checking string suffix\nSyntax: (ends-with? s suffix)\nParams: s (string), suffix (string)\nReturns: boolean\nReturns true if string ends with suffix")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string :string
        |enum? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is an enum definition.")
          :code $ quote
            defn enum? (x)
              &= (type-of x) :enum
          :examples $ []
            quote $ assert= true
              enum? $ defenum Result (:ok) (:err :string)
            quote $ assert= false
              enum? $ :: :ok 1
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |eval $ %{} :CodeEntry (:doc "|internal syntax for evaluating code at runtime\nSyntax: (eval expr)\nParams: expr (quoted code)\nReturns: result of evaluation\nEvaluates quoted code in current environment") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |even? $ %{} :CodeEntry (:doc "|check if number is even?")
          :code $ quote
            defn even? (n)
              &= 0 $ &number:rem n 2
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number
        |every? $ %{} :CodeEntry (:doc "|Checks whether every element of a collection satisfies a predicate, short-circuiting on the first failure.")
          :code $ quote
            defn every? (xs f)
              foldl-shortcut xs true true $ defn %every? (acc x)
                if (f x) (:: false acc) (:: true false)
          :examples $ []
            quote $ assert= true
              every? ([] 2 4 6)
                defn %even (x)
                  &= 0 $ .rem x 2
            quote $ assert= false
              every? ([] 1 2 3)
                defn %gt1 (x) (&> x 1)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
        |exclude $ %{} :CodeEntry (:doc "|Removes values from a collection by repeatedly calling `&exclude` for each provided item.")
          :code $ quote
            defn exclude (base & xs)
              reduce xs base $ fn (acc item) (&exclude acc item)
          :examples $ []
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :set)
              :args $ [] :set
        |field-match $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro field-match (value & body)
              if (&list:empty? body) (raise "|field-match expected patterns for matching")
                if (list? value)
                  &let
                    v# $ gensym |v
                    quasiquote $ &let (~v# ~value)
                      assert "|expected map value to match" $ map? ~v#
                      internal/&field-match-internal ~v# ~@body
                  quasiquote $ &let ()
                    assert "|expected map value to match" $ map? ~value
                    internal/&field-match-internal ~value ~@body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |filter $ %{} :CodeEntry (:doc "|Builds a new collection containing only the elements where the predicate returns truthy, preserving the original collection type when possible.")
          :code $ quote
            defn filter (xs f)
              if (nil? xs) nil $ if (list? xs) (&list:filter xs f) (.filter xs f)
          :examples $ []
            quote $ assert= ([] 2 4)
              filter ([] 1 2 3 4 5)
                defn %even? (x)
                  &= 0 $ .rem x 2
            quote $ assert= ([] |bb |ccc)
              filter ([] |a |bb |ccc)
                defn %long? (s)
                  &> (&str:count s) 1
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :fn
        |filter-not $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn filter-not (xs f)
              if (nil? xs) nil $ filter xs
                defn %filter-not (x)
                  not $ f x
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :list 'T
        |find $ %{} :CodeEntry (:doc "|Find the first element in a collection that satisfies the predicate f")
          :code $ quote
            defn find (xs f)
              foldl-shortcut xs 0 nil $ defn %find (_acc x)
                if (f x) (:: true x) (:: false nil)
          :examples $ []
            quote $ assert= 4
              find ([] 1 2 3 4 5)
                fn (x) (&> x 3)
            quote $ assert= nil
              find ([] 1 2 3)
                fn (x) (&> x 10)
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :optional 'T
        |find-index $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn find-index (xs f)
              foldl-shortcut xs 0 nil $ defn %find-index (idx x)
                if (f x) (:: true idx)
                  :: false $ &+ 1 idx
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T
              :generics $ [] 'T
              :return $ :: :optional :number
        |first $ %{} :CodeEntry (:doc "|Returns the first element of a list, tuple, string, or other sequential structure\nNil inputs return nil, and empty collections also produce nil.")
          :code $ quote
            defn first (x)
              if (nil? x) nil $ if (list? x) (&list:first x) (.first x)
          :examples $ []
            quote $ assert= 1
              first $ [] 1 2 3
            quote $ assert= |h (first |hello)
            quote $ assert= nil (first nil)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |flipped $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro flipped (f & args)
              quasiquote $ ~f
                ~@ $ reverse args
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |floor $ %{} :CodeEntry (:doc "|internal function for floor operation\nSyntax: (floor n)\nParams: n (number)\nReturns: number\nReturns largest integer less than or equal to n")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |fn $ %{} :CodeEntry (:doc "|macro for anonymous functions\nSyntax: (fn (args...) body...)\nParams: args (parameter list), body (expressions)\nReturns: anonymous function\nCreates an anonymous function, shorter than defn")
          :code $ quote
            defmacro fn (args & body)
              if
                not $ list? args
                raise $ str-spaced "|fn expects args in list, got:" args
              if (&list:empty? body)
                quasiquote $ defn f% ~args nil
                quasiquote $ defn f% ~args ~@body
          :examples $ []
            quote $ map ([] 1 2 3)
              fn (x) (* x 2)
            quote $ filter ([] 1 2 3 4 5)
              fn (n) (> n 2)
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |fn? $ %{} :CodeEntry (:doc "|Check if a value is a function")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true (fn? inc)
            quote $ assert= false (fn? 123)
            quote $ assert= false (fn? |text)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |foldl $ %{} :CodeEntry (:doc "|internal function for left fold\nSyntax: (foldl list initial reducer)\nParams: list (list), initial (any), reducer (function)\nReturns: any\nFolds list from left with reducer function and initial value")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :fn
        |foldl' $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn foldl' (xs acc f)
              list-match xs
                () acc
                (x0 xss)
                  recur xss (f acc x0) f
          :examples $ []
          :schema $ :: :fn
            {} (:return 'U)
              :args $ [] (:: :list 'T) 'U
                :: :fn $ {} (:return 'U)
                  :args $ [] 'U 'T
              :generics $ [] 'T 'U
        |foldl-compare $ %{} :CodeEntry (:doc "|Helper used by comparison operators to ensure a relation holds across an entire list, short-circuiting on the first failure.")
          :code $ quote
            defn foldl-compare (xs acc f)
              if (&list:empty? xs) true $ if
                f acc $ &list:first xs
                recur (&list:rest xs) (&list:first xs) f
                , false
          :examples $ []
            quote $ assert= true
              foldl-compare ([] 1 2 3 4) 0 &<
            quote $ assert= false
              foldl-compare ([] 1 3 2 4) 0 &<
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] (:: :list 'T) 'T
                :: :fn $ {} (:return :bool)
                  :args $ [] 'T 'T
              :generics $ [] 'T
        |foldl-shortcut $ %{} :CodeEntry (:doc "|internal function for left fold with shortcut\nSyntax: (foldl-shortcut list initial reducer)\nParams: list (list), initial (any), reducer (function)\nReturns: any\nFolds list from left with early termination support")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :dynamic :fn
        |foldr-shortcut $ %{} :CodeEntry (:doc "|internal function for right fold with shortcut\nSyntax: (foldr-shortcut list initial reducer)\nParams: list (list), initial (any), reducer (function)\nReturns: any\nFolds list from right with early termination support")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :list :dynamic :fn
        |format-cirru $ %{} :CodeEntry (:doc "|internal function for formatting Cirru\nSyntax: (format-cirru data)\nParams: data (list)\nReturns: string\nFormats nested list structure into Cirru syntax text")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :list
        |format-cirru-edn $ %{} :CodeEntry (:doc "|internal function for formatting Cirru EDN\nSyntax: (format-cirru-edn data)\nParams: data (any)\nReturns: string\nFormats Calcit data structures into Cirru EDN format text")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |format-cirru-one-liner $ %{} :CodeEntry (:doc "|internal function for formatting Cirru as one-liner\nSyntax: (format-cirru-one-liner data)\nParams: data (list)\nReturns: string\nFormats nested list structure into Cirru one-liner syntax text")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :list
        |format-to-cirru $ %{} :CodeEntry (:doc "|internal function for formatting to Cirru syntax\nSyntax: (format-to-cirru value)\nParams: value (any)\nReturns: string in Cirru format\nConverts Calcit data structures to Cirru-style string representation")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |format-to-lisp $ %{} :CodeEntry (:doc "|internal function for formatting to Lisp syntax\nSyntax: (format-to-lisp value)\nParams: value (any)\nReturns: string in Lisp format\nConverts Calcit data structures to Lisp-style string representation")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |frequencies $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn frequencies (xs0)
              assert "|expects a list for frequencies" $ list? xs0
              apply-args
                  {}
                  , xs0
                fn (acc xs)
                  list-match xs
                    () acc
                    (x0 xss)
                      recur
                        if (contains? acc x0)
                          update acc x0 $ \ &+ % 1
                          &map:assoc acc x0 1
                        , xss
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :list
        |generate-id! $ %{} :CodeEntry (:doc "|internal function for generating unique IDs\nSyntax: (generate-id!)\nParams: none\nReturns: unique string ID\nGenerates a unique identifier string for runtime use")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ []
        |gensym $ %{} :CodeEntry (:doc "|internal syntax for generating unique symbols\nSyntax: (gensym) or (gensym prefix)\nParams: prefix (string, optional)\nReturns: unique symbol\nGenerates a unique symbol for macro hygiene") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |get $ %{} :CodeEntry (:doc "|Reads a value from collections or strings by key or index. Handles maps, lists, tuples, records, and strings; nil bases return nil.")
          :code $ quote
            defn get (base k)
              if (nil? base) nil $ if (list? base) (&list:nth base k) (.get base k)
          :examples $ []
            quote $ assert= 2
              get ([] 0 2 4) 1
            quote $ assert= |b (get |abc 1)
            quote $ assert= nil (get nil :missing)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic
        |get-char-code $ %{} :CodeEntry (:doc "|internal function for getting character code\nSyntax: (get-char-code char)\nParams: char (string, single character)\nReturns: number\nReturns Unicode code point of character")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :string
        |get-env $ %{} :CodeEntry (:doc "|internal function for getting environment variables\nSyntax: (get-env var-name)\nParams: var-name (string)\nReturns: string value or nil\nGets environment variable value, returns nil if not found")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] :string
              :return $ :: :optional :string
        |get-in $ %{} :CodeEntry (:doc "|Get value from nested data structure using a path of keys")
          :code $ quote
            defn get-in (base path)
              if
                not $ list? path
                raise $ str-spaced "|expects path in a list, got:" path
              if (nil? base) nil $ list-match path
                () base
                (y0 ys)
                  recur (get base y0) ys
          :examples $ []
            quote $ assert= 1
              get-in
                {} $ :a
                  {} $ :b 1
                [] :a :b
            quote $ assert= 2
              get-in
                [] ([] 1 2) ([] 3 4)
                [] 0 1
            quote $ assert= nil
              get-in
                {} $ :x |value
                [] :y
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :list
        |group-by $ %{} :CodeEntry (:doc "|Group elements by the result of applying function f to each element")
          :code $ quote
            defn group-by (xs0 f)
              apply-args
                  {}
                  , xs0
                defn %group-by (acc xs)
                  hint-fn $ {}
                    :args $ []
                      :: :map 'K $ :: :list 'T
                      :: :list 'T
                    :return $ :: :map 'K (:: :list 'T)
                  list-match xs
                    () acc
                    (x0 xss)
                      let
                          key $ f x0
                        recur
                          if (contains? acc key)
                            update acc key $ \ append % x0
                            &map:assoc acc key $ [] x0
                          , xss
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {} (:return 'K)
                  :args $ [] 'T
              :generics $ [] 'T 'K
              :return $ :: :map 'K (:: :list 'T)
        |hint-fn $ %{} :CodeEntry (:doc "|internal syntax for function hints (used for async and generics)\nSyntax: (hint-fn hint-data fn-expr)\nParams: hint-data (keyword or list), fn-expr (function)\nReturns: hinted function\nAdds execution hints to functions, including async markers and generic type metadata (type-vars, return-type)") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |identical? $ %{} :CodeEntry (:doc "|internal function for identity comparison\nSyntax: (identical? a b)\nParams: a (any), b (any)\nReturns: boolean\nReturns true if two values are identical (same reference), not just equal")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |identity $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn identity (x) x
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |if $ %{} :CodeEntry (:doc "|internal syntax for conditional expressions\nSyntax: (if condition then-expr else-expr)\nParams: condition (any), then-expr (any), else-expr (any, optional)\nReturns: value of then-expr if condition is truthy, else-expr otherwise\nEvaluates condition and returns appropriate branch") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ if (> x 0) |positive |non-positive
            quote $ if (empty? xs) 0 (count xs)
        |if-let $ %{} :CodeEntry (:doc "|Conditionally binds the result of an expression to a symbol and executes the matching branch when the value is non-nil.")
          :code $ quote
            defmacro if-let (pair then ? else)
              if
                not $ and (list? pair)
                  &= 2 $ count pair
                raise $ str-spaced "|expected a pair, got:" pair
              &let
                x $ nth pair 0
                if
                  not $ symbol? x
                  raise $ str-spaced "|expected a symbol for var name, got:" x
                quasiquote $ &let
                  ~x $ ~ (nth pair 1)
                  if (some? ~x) ~then ~else
          :examples $ []
            quote $ assert= |found
              if-let
                v $ :: :some |found
                , v |missing
            quote $ assert= |missing
              if-let
                v $ :: :none
                , v |missing
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |if-not $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defmacro if-not (& xs)
              if
                not $ or
                  &= 2 $ &list:count xs
                  &= 3 $ &list:count xs
                raise $ str-spaced "|if-not expects (condition then) or (condition then else), got:" xs
              &let
                condition $ &list:nth xs 0
                &let
                  true-branch $ &list:nth xs 1
                  &let
                    false-branch $ if
                      &= 3 $ &list:count xs
                      &list:nth xs 2
                      , nil
                    quasiquote $ if ~condition ~false-branch ~true-branch
          :examples $ []
        |impl-traits $ %{} :CodeEntry (:doc "|Append trait implementations\nSyntax: (impl-traits value & traits)\nParams: value (struct/enum), traits (impl, variadic)\nReturns: value with updated trait implementations\nDispatches to &struct:impl-traits, &enum:impl-traits")
          :code $ quote
            defn impl-traits (x & traits)
              if
                not $ every? traits
                  fn (trait)
                    = :impl $ type-of trait
                raise "|impl-traits misuse. Expected: impl arguments are :impl values. Actual: found non-impl argument. Fix: pass values created by `defimpl`."
              if (struct? x) (&struct:impl-traits x & traits)
                if (enum? x) (&enum:impl-traits x & traits)
                  raise $ str-spaced "|impl-traits misuse. Expected: first argument is struct/enum definition. Actual:" (type-of x) "|Fix: attach impls to `defstruct`/`defenum` result, then construct instances from that definition."
          :examples $ []
          :schema $ :: :fn
            {} (:rest :tag) (:return :dynamic)
              :args $ [] :dynamic
        |inc $ %{} :CodeEntry (:doc "|Increments a number by 1")
          :code $ quote
            defn inc (x) (&+ x 1)
          :examples $ []
            quote $ assert= 6 (inc 5)
            quote $ assert= 1 (inc 0)
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |include $ %{} :CodeEntry (:doc "|Add elements to a set, returns a new set with the elements included")
          :code $ quote
            defn include (base & xs)
              reduce xs base $ fn (acc item) (&include acc item)
          :examples $ []
            quote $ assert= (#{} 1 2 3 4)
              include (#{} 1 2) 3 4
            quote $ assert= (#{} 1 2 3)
              include (#{} 1 2) 2 3
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :set)
              :args $ [] :set
        |includes? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn includes? (x k)
              if (nil? x) false $ if (list? x) (&list:includes? x k) (.includes? x k)
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |index-of $ %{} :CodeEntry (:doc "|Find the first index of an item in a list, returns nil if not found")
          :code $ quote
            defn index-of (xs item)
              foldl-shortcut xs 0 nil $ defn %index-of (idx x)
                if (&= item x) (:: true idx)
                  :: false $ &+ 1 idx
          :examples $ []
            quote $ assert= 1
              index-of ([] |a |b |c) |b
            quote $ assert= nil
              index-of ([] 1 2 3) 5
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) 'T
              :generics $ [] 'T
              :return $ :: :optional :number
        |interleave $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn interleave (xs0 ys0)
              apply-args
                  []
                  , xs0 ys0
                defn %interleave (acc xs ys)
                  hint-fn $ {}
                    :args $ [] (:: :list 'T) (:: :list 'T) (:: :list 'T)
                    :return $ :: :list 'T
                  if
                    if (&list:empty? xs) true $ &list:empty? ys
                    , acc $ recur
                      -> acc
                        append $ &list:first xs
                        append $ &list:first ys
                      rest xs
                      rest ys
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |intersection $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn intersection (base & xs)
              reduce xs base $ fn (acc item) (&set:intersection acc item)
          :examples $ []
          :schema $ :: :fn
            {} (:rest :set) (:return :set)
              :args $ [] :set
        |is-spreading-mark? $ %{} :CodeEntry (:doc "|internal function for detecting syntax &\nSyntax: (is-spreading-mark? value)\nParams: value (any)\nReturns: boolean\nReturns true if value is the spreading mark symbol &")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |join $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn join (xs0 sep)
              apply-args
                  []
                  , xs0 true
                defn %join (acc xs beginning?)
                  hint-fn $ {}
                    :args $ [] (:: :list 'T) (:: :list 'T) :bool
                    :return $ :: :list 'T
                  list-match xs
                    () acc
                    (x0 xss)
                      recur
                        append
                          if beginning? acc $ append acc sep
                          , x0
                        , xss false
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) 'T
              :generics $ [] 'T
              :return $ :: :list 'T
        |join-str $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn join-str (xs0 sep)
              apply-args (| xs0 true)
                defn %join-str (acc xs beginning?)
                  hint-fn $ {}
                    :args $ [] :string :list :bool
                    :return :string
                  list-match xs
                    () acc
                    (x0 xss)
                      recur
                        &str:concat
                          if beginning? acc $ &str:concat acc sep
                          , x0
                        , xss false
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :list :string
        |js-object $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defmacro js-object (& xs)
              if
                not $ and (list? xs) (every? xs list?)
                raise $ str-spaced "|js-object expects entries in list, got:" xs
              if
                not $ every? xs
                  fn (entry)
                    &= 2 $ &list:count entry
                raise $ str-spaced "|js-object expects each entry as pair, got:" xs
              &let
                ys $ &list:concat & xs
                quasiquote $ &js-object ~@ys
          :examples $ []
        |json-parse $ %{} :CodeEntry (:doc "|internal function for parsing JSON text\nSyntax: (json-parse text)\nParams: text (string)\nReturns: Calcit data\nParses JSON text into Calcit values. JSON object keys become tags, arrays become lists, and null becomes nil")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert=
              {} $ :a 1
              json-parse "|{\"a\":1}"
            quote $ assert= ([] true nil)
              get (json-parse "|{\"items\":[true,null]}") :items
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :string
        |json-pretty $ %{} :CodeEntry (:doc "|internal function for pretty-printing JSON\nSyntax: (json-pretty value)\nParams: value (any JSON-compatible Calcit data)\nReturns: string\nConverts Calcit data into formatted JSON text using 2-space indentation")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= "|{\n  \"a\": 1\n}"
              json-pretty $ {} (:a 1)
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |json-stringify $ %{} :CodeEntry (:doc "|internal function for encoding JSON\nSyntax: (json-stringify value)\nParams: value (any JSON-compatible Calcit data)\nReturns: string\nConverts Calcit data into compact JSON text. Tags and symbols are encoded as plain JSON strings")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= "|\"ok\"" (json-stringify :ok)
            quote $ assert= "|{\"a\":1}"
              json-stringify $ {} (:a 1)
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |keys $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn keys (x)
              map (to-pairs x) &list:first
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :dynamic
        |keys-non-nil $ %{} :CodeEntry (:doc "|Get keys from a map that have non-nil values")
          :code $ quote
            defn keys-non-nil (x)
              apply-args
                  #{}
                  to-pairs x
                fn (acc pairs)
                  hint-fn $ {}
                    :args $ [] (:: :set 'K) :set
                    :return $ :: :set 'K
                  if (&set:empty? pairs) acc $ &let
                    set-pair $ &set:destruct pairs
                    &let
                      pair $ nth set-pair 0
                      if
                        nil? $ last pair
                        recur acc $ nth set-pair 1
                        recur
                          include acc $ &list:first pair
                          nth set-pair 1
          :examples $ []
            quote $ assert= (#{} :a :b)
              keys-non-nil $ {} (:a 1) (:b 2) (:c nil)
            quote $ assert= (#{})
              keys-non-nil $ {} (:a nil) (:b nil)
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V)
              :generics $ [] 'K 'V
              :return $ :: :set 'K
        |last $ %{} :CodeEntry (:doc "|Returns the last element of a list-like collection\nReturns nil when the collection is empty.")
          :code $ quote
            defn last (xs)
              if (empty? xs) nil $ nth xs
                &- (count xs) 1
          :examples $ []
            quote $ assert= 3
              last $ [] 1 2 3
            quote $ assert= nil
              last $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |let $ %{} :CodeEntry (:doc "|macro for local bindings\nSyntax: (let ([name value] ...) body...)\nParams: pairs (list of binding pairs), body (expressions)\nReturns: result of body with bindings in scope\nCreates multiple local bindings sequentially")
          :code $ quote
            defmacro let (pairs & body)
              if
                not $ and (list? pairs) (every? pairs list?)
                raise $ str-spaced "|expects pairs in list for let, got:" pairs
              if
                &= 1 $ &list:count pairs
                quasiquote $ &let
                  ~ $ &list:nth pairs 0
                  ~@ body
                if (&list:empty? pairs)
                  quasiquote $ &let () ~@body
                  quasiquote $ &let
                    ~ $ &list:nth pairs 0
                    let
                      ~ $ &list:rest pairs
                      ~@ body
          :examples $ []
            quote $ let
                x 1
                y 2
              + x y
            quote $ let
                a 10
              * a a
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |let-destruct $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro let-destruct (pattern v & body)
              if (symbol? pattern)
                quasiquote $ &let (~pattern ~v) ~@body
                if (list? pattern)
                  if
                    &= [] $ &list:first pattern
                    quasiquote $ let[]
                      ~ $ &list:rest pattern
                      , ~v ~@body
                    if
                      &= '{} $ &list:first pattern
                      quasiquote $ let{}
                        ~ $ &list:rest pattern
                        , ~v ~@body
                      raise $ str-spaced "|Unknown pattern to destruct:" pattern
                  raise $ str-spaced "|Unknown structure to destruct:" pattern
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |let-sugar $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro let-sugar (pairs & body)
              if
                not $ and (list? pairs) (every? pairs list?)
                raise $ str-spaced "|expects pairs in list for let, got:" pairs
              if (&list:empty? pairs)
                quasiquote $ &let () ~@body
                &let
                  pair $ &list:first pairs
                  if
                    not $ &= 2 (&list:count pair)
                    raise $ str-spaced "|expected pair length of 2, got:" pair
                  if
                    &= 1 $ &list:count pairs
                    quasiquote $ let-destruct ~@pair (~@ body)
                    quasiquote $ let-destruct ~@pair
                      let-sugar
                        ~ $ &list:rest pairs
                        ~@ body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |let[] $ %{} :CodeEntry (:doc "|Destructures a sequential value inside `let`, assigning each position to declared names and supporting `&` rest bindings.")
          :code $ quote
            defmacro let[] (vars data & body)
              if
                not $ and (list? vars)
                  every? vars $ fn (x)
                    or (symbol? x) (is-spreading-mark? x)
                raise $ str-spaced "|expects a list of definitions, got:" vars
              let
                  variable? $ symbol? data
                  v $ if variable? data (gensym |v)
                  defs $ apply-args
                    [] ([]) vars 0
                    defn let[]% (acc xs idx)
                      if (&list:empty? xs) acc $ &let ()
                        if
                          not $ or
                            symbol? $ &list:first xs
                            is-spreading-mark? $ &list:first xs
                          raise $ &str:concat "|Expected symbol for vars: " (&list:first xs)
                        if
                          is-spreading-mark? $ &list:first xs
                          &let ()
                            assert "|expected list spreading" $ &= 2 (&list:count xs)
                            append acc $ [] (&list:nth xs 1)
                              quasiquote $ &list:slice ~v ~idx
                          recur
                            append acc $ [] (&list:first xs)
                              quasiquote $ &list:nth ~v ~idx
                            rest xs
                            inc idx
                if variable?
                  quasiquote $ let (~ defs) (~@ body)
                  quasiquote $ &let (~v ~data)
                    let (~ defs) (~@ body)
          :examples $ []
            quote $ let[] (x y) ([] 1 2) (+ x y)
            quote $ let[] (head & tail) ([] 9 8 7) (count tail)
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |let{} $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro let{} (items base & body)
              if
                not $ and (list? items) (every? items symbol?)
                raise $ str-spaced "|expects symbol names in binding names, got:" items
              &let
                var-result $ gensym |result
                quasiquote $ &let (~var-result ~base)
                  assert (str "|expected map for destructing: " ~var-result) (map? ~var-result)
                  let
                    ~ $ map items
                      defn gen-items% (x)
                        [] x $ [] (turn-tag x) var-result
                    ~@ body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |list-match $ %{} :CodeEntry (:doc "|Two-branch list destructuring macro. Provides separate clauses for the empty list and a head/tail pattern, useful for simple recursion or guards.") (:schema :dynamic)
          :code $ quote
            defmacro list-match (& values)
              if
                not $ &= 3 (&list:count values)
                raise $ str-spaced "|list-match expects exactly 3 arguments, got:" values
              &let
                xs $ &list:nth values 0
                &let
                  pattern1 $ &list:nth values 1
                  &let
                    pattern2 $ &list:nth values 2
                    if
                      not $ and (list? pattern1) (list? pattern2)
                        &> (count pattern1) 1
                        list? $ &list:nth pattern1 0
                        list? $ &list:nth pattern2 0
                        &> (count pattern2) 1
                      raise $ str-spaced "|list-match expects 2 branches: (() body...) and ((head tail) body...), got:" pattern1 pattern2
                    &let
                      v# $ gensym |v
                      quasiquote $ &let (~v# ~xs)
                        if
                          not $ list? ~v#
                          raise "|expected a list in list-match"
                        ~ $ if
                          and
                            empty? $ &list:nth pattern1 0
                            &= 2 $ count (&list:nth pattern2 0)
                          quasiquote $ &list-match-internal ~v#
                            ~ $ &list:slice pattern1 1
                            ~ $ &list:nth pattern2 0
                            ~ $ &list:slice pattern2 1
                          if
                            and
                              empty? $ &list:nth pattern2 0
                              &= 2 $ count (&list:nth pattern1 0)
                            quasiquote $ &list-match-internal ~v#
                              ~ $ &list:slice pattern2 1
                              ~ $ &list:nth pattern1 0
                              ~ $ &list:slice pattern1 1
                            raise $ str-spaced "|list-match expects one empty branch and one destructuring branch, got:" pattern1 pattern2
          :examples $ []
            quote $ assert= :something
              list-match ([] 1)
                () :empty
                (a b) :something
            quote $ assert= 1
              list-match ([] 1 2 3)
                () nil
                (head tail) head
        |list? $ %{} :CodeEntry (:doc "|checks if value is a list\nSyntax: (list? x)\nParams: x (any)\nReturns: true if x is a list, false otherwise\nType predicate for list data structure")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ list? ([] 1 2 3)
            quote $ list? ({})
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |loop $ %{} :CodeEntry (:doc "|Named-let style looping macro. Binds initial values once and uses `recur` to update bindings in a tail-recursive way without stack growth.")
          :code $ quote
            defmacro loop (pairs & body)
              if
                not $ list? pairs
                raise $ str-spaced "|expects pairs in loop, got:" pairs
              if
                not $ every? pairs
                  defn detect-pairs? (x)
                    if (list? x)
                      &= 2 $ &list:count x
                      , false
                raise $ str-spaced "|expects pairs in pairs in loop, got:" pairs
              let
                  args $ map pairs &list:first
                  values $ map pairs last
                assert "|loop requires symbols in pairs" $ every? args symbol?
                quasiquote $ apply (defn generated-loop ~args ~@body) ([] ~@values)
          :examples $ []
            quote $ assert= 6
              loop
                  total 0
                (xs ([] 1 2 3))
                if (empty? xs) total $ recur
                  + total $ first xs
                  rest xs
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |macro? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn macro? (x)
              &= (type-of x) :macro
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |macroexpand $ %{} :CodeEntry (:doc "|internal syntax for expanding macros until recursive calls are resolved\nSyntax: (macroexpand expr)\nParams: expr (macro call)\nReturns: fully expanded code\nExpands macros recursively until no more macro calls remain") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |macroexpand-1 $ %{} :CodeEntry (:doc "|internal syntax for expanding macro just once for debugging\nSyntax: (macroexpand-1 expr)\nParams: expr (macro call)\nReturns: one-level expanded code\nExpands macro only one level for debugging purposes") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |macroexpand-all $ %{} :CodeEntry (:doc "|internal syntax for expanding macro until macros inside are resolved\nSyntax: (macroexpand-all expr)\nParams: expr (code with macros)\nReturns: fully expanded code\nExpands all macros including nested ones") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |map $ %{} :CodeEntry (:doc "|Collection mapping function. Applies a function to each element of a list, set, or map, returning a structure of the same shape.")
          :code $ quote
            defn map (xs f)
              if (list? xs) (&list:map xs f)
                if (set? xs)
                  foldl xs (#{})
                    defn %map (acc x)
                      hint-fn $ {}
                        :args $ [] :set :dynamic
                        :return :set
                      include acc $ f x
                  .map xs f
          :examples $ []
            quote $ assert= ([] 2 3 4)
              map ([] 1 2 3) inc
            quote $ assert= ([] |1 |2 |3)
              map ([] 1 2 3) str
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
                :: :fn $ {} (:return 'U)
                  :args $ [] 'T
              :generics $ [] 'T 'U
        |map-indexed $ %{} :CodeEntry (:doc "|Map over a collection with index, f takes index and value")
          :code $ quote
            defn map-indexed (xs f)
              foldl xs ([])
                defn %map-indexed (acc x)
                  hint-fn $ {}
                    :generics $ [] 'U
                    :args $ []
                      :: 'acc $ :: :list 'U
                      :: 'x :dynamic
                    :return $ :: :list 'U
                  append acc $ f (count acc) x
          :examples $ []
            quote $ assert= ([] 10 21 32)
              map-indexed ([] 10 20 30)
                fn (i x) (&+ i x)
            quote $ assert=
              [] ([] 0 |a) ([] 1 |b)
              map-indexed ([] |a |b)
                fn (i x) ([] i x)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :fn
        |map-kv $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn map-kv (xs f)
              foldl xs ({})
                defn %map-kv (acc pair)
                  hint-fn $ {}
                    :args $ [] :map :list
                    :return :map
                  &let
                    result $ f (nth pair 0) (nth pair 1)
                    if (list? result)
                      do
                        assert "|expected pair returned when mapping hashmap" $ &= 2 (&list:count result)
                        &map:assoc acc (nth result 0) (nth result 1)
                      if
                        or (nil? result) (tuple? result)
                        , acc $ raise (str-spaced "|map-kv expected list or nil, got:" result)
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] (:: :map 'K 'V)
                :: :fn $ {} (:return 'R)
                  :args $ [] 'K 'V
              :generics $ [] 'K 'V 'R
        |map? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a map")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true
              map? $ {} (:a 1)
            quote $ assert= false
              map? $ [] 1 2
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |mapcat $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn mapcat (xs f)
              &list:concat & $ map xs f
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
                :: :fn $ {}
                  :args $ [] 'T
                  :return $ :: :list 'U
              :generics $ [] 'T 'U
              :return $ :: :list 'U
        |max $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn max (xs) (.max xs)
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |merge $ %{} :CodeEntry (:doc "|Combines maps left-to-right, with later maps overwriting keys from earlier ones by reducing through `&merge`.")
          :code $ quote
            defn merge (x0 & xs) (reduce xs x0 &merge)
          :examples $ []
            quote $ assert=
              {} (:a 2) (:b 1)
              merge
                {} $ :a 1
                {} (:a 2) (:b 1)
            quote $ assert=
              {} (:a 1) (:b 2) (:c 3)
              merge
                {} $ :a 1
                {} $ :b 2
                {} $ :c 3
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :dynamic)
              :args $ [] :dynamic
        |merge-non-nil $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn merge-non-nil (x0 & xs) (reduce xs x0 &merge-non-nil)
          :examples $ []
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :map)
              :args $ [] :dynamic
        |min $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn min (xs) (.min xs)
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |negate $ %{} :CodeEntry (:doc "|Negate a number, returns its opposite")
          :code $ quote
            defn negate (x) (&- 0 x)
          :examples $ []
            quote $ assert= -5 (negate 5)
            quote $ assert= 3 (negate -3)
            quote $ assert= 0 (negate 0)
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |nil? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is nil")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true (nil? nil)
            quote $ assert= false (nil? 0)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |non-nil! $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn non-nil! (x)
              if (nil? x) (raise "|expected non nil value") x
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |not $ %{} :CodeEntry (:doc "|internal function for logical not\nSyntax: (not value)\nParams: value (any)\nReturns: boolean\nReturns true if value is falsy (nil or false), false otherwise")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |not= $ %{} :CodeEntry (:doc "|Returns true when its two arguments are not identical according to `=`.")
          :code $ quote
            defn not= (x y)
              not $ &= x y
          :examples $ []
            quote $ assert= true (not= 1 2)
            quote $ assert= false (not= :a :a)
            quote $ assert= true (not= |a |b)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :dynamic
        |noted $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro noted (_doc v) v
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |nth $ %{} :CodeEntry (:doc "|Returns the element at index `i` from a list, tuple, or sequential data structure\nRaises if the index is outside the available range.")
          :code $ quote
            defn nth (x i)
              if (list? x) (&list:nth x i) (.nth x i)
          :examples $ []
            quote $ assert= 2
              nth ([] 1 2 3) 1
            quote $ assert= |b (nth |abc 1)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :number
        |number? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a numeric scalar")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true (number? 123)
            quote $ assert= true (number? 3.14)
            quote $ assert= false (number? |text)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |option:map $ %{} :CodeEntry (:doc "|Mappable map implementation for Option")
          :code $ quote
            defn option:map (opt f)
              tag-match opt
                  :some value
                  %:: (&tuple:enum opt) :some $ f value
                (:none)
                  %:: (&tuple:enum opt) :none
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
                :: :fn $ {} (:return 'U)
                  :args $ [] 'T
              :generics $ [] 'T 'U
        |optionally $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn optionally (s)
              if (nil? s) (:: :none) (:: :some s)
          :examples $ []
          :schema $ :: :fn
            {} (:return :tuple)
              :args $ [] :dynamic
        |or $ %{} :CodeEntry (:doc "|Logical disjunction macro. Skips evaluating later forms once a truthy (non-nil, non-false) value is found, preserving the first truthy result.") (:schema :dynamic)
          :code $ quote
            defmacro or (item & xs)
              if (&list:empty? xs) item $ if (list? item)
                &let
                  v1# $ gensym |v1
                  quasiquote $ &let (~v1# ~item)
                    if (nil? ~v1#)
                      or
                        ~ $ &list:first xs
                        ~@ $ &list:rest xs
                      if (&= false ~v1#)
                        or
                          ~ $ &list:first xs
                          ~@ $ &list:rest xs
                        ~ v1#
                quasiquote $ if (nil? ~item)
                  or
                    ~ $ &list:first xs
                    ~@ $ &list:rest xs
                  if (&= false ~item)
                    or
                      ~ $ &list:first xs
                      ~@ $ &list:rest xs
                    ~ item
          :examples $ []
            quote $ assert= |done (or nil |done false)
            quote $ assert= false (or false nil)
            quote $ assert= 2 (or nil 2 3)
        |pairs-map $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn pairs-map (xs)
              reduce xs ({})
                defn %pairs-map (acc pair)
                  hint-fn $ {}
                    :args $ [] :map :list
                    :return :map
                  assert "|expects pair for pairs-map" $ if (list? pair)
                    &= 2 $ &list:count pair
                    , false
                  &map:assoc acc (&list:first pair) (last pair)
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :list
        |parse-cirru $ %{} :CodeEntry (:doc "|internal function for parsing Cirru\nSyntax: (parse-cirru text)\nParams: text (string)\nReturns: list\nParses Cirru syntax text into nested list structure")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :string
        |parse-cirru-edn $ %{} :CodeEntry (:doc "|internal function for parsing Cirru EDN\nSyntax: (parse-cirru-edn text)\nParams: text (string)\nReturns: any\nParses Cirru EDN format text into Calcit data structures")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :string
        |parse-cirru-list $ %{} :CodeEntry (:doc "|internal function for parsing Cirru list\nSyntax: (parse-cirru-list text)\nParams: text (string)\nReturns: list\nParses Cirru text as a list of expressions")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :string
        |parse-float $ %{} :CodeEntry (:doc "|internal function for parsing float\nSyntax: (parse-float s)\nParams: s (string)\nReturns: number or nil\nParses string as floating point number, returns nil if invalid")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] :string
              :return $ :: :optional :number
        |pow $ %{} :CodeEntry (:doc "|internal function for power operation\nSyntax: (pow base exponent)\nParams: base (number), exponent (number)\nReturns: number\nRaises base to the power of exponent")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number :number
        |prepend $ %{} :CodeEntry (:doc "|internal function for prepending to list\nSyntax: (prepend list element)\nParams: list (list), element (any)\nReturns: list\nReturns new list with element added at beginning")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list :dynamic
        |quasiquote $ %{} :CodeEntry (:doc "|internal syntax for quasiquote (used inside macros)\nSyntax: (quasiquote expr)\nParams: expr (code with possible unquote)\nReturns: partially quoted structure\nLike quote but allows selective unquoting with ~ and ~@") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ quasiquote (&+ ~x 1)
            quote $ quasiquote ([] ~x ~@xs)
        |quit! $ %{} :CodeEntry (:doc "|internal function for quitting program\nSyntax: (quit! exit-code)\nParams: exit-code (number, optional, defaults to 0)\nReturns: never returns (exits program)\nTerminates the program with specified exit code")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :unit)
              :args $ [] (:: :optional :number)
        |quote $ %{} :CodeEntry (:doc "|internal syntax for turning code into quoted data\nSyntax: (quote expr)\nParams: expr (any code)\nReturns: quoted data structure\nPrevents evaluation and returns code as data") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |raise $ %{} :CodeEntry (:doc "|internal function for raising exceptions\nSyntax: (raise message)\nParams: message (string)\nReturns: never returns (throws exception)\nThrows an exception with the given message")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :string
        |range $ %{} :CodeEntry (:doc "|internal function for creating number ranges\nSyntax: (range start end) or (range end)\nParams: start (number, optional), end (number)\nReturns: list\nCreates list of numbers from start to end (exclusive)")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :number (:: :optional :number)
        |range-bothway $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn range-bothway (x ? y)
              if-let (y0 y)
                range
                  inc $ &- (&+ x x) y0
                  , y0
                range
                  inc $ negate x
                  , x
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] :number (:: :optional :number)
              :return $ :: :list :number
        |read-file $ %{} :CodeEntry (:doc "|internal function for reading files\nSyntax: (read-file filepath)\nParams: filepath (string)\nReturns: string content or error\nReads file content as string, throws error if file not found")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |record-match $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro record-match (value & body)
              if (&list:empty? body) (raise "|record-match expected patterns for matching")
                if (list? value)
                  &let
                    v# $ gensym |v
                    quasiquote $ &let (~v# ~value)
                      assert "|expected record to match" $ record? ~v#
                      &record-match-internal ~v# ~@body
                  quasiquote $ &let ()
                    assert "|expected record to match" $ record? ~value
                    &record-match-internal ~value ~@body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |record-with $ %{} :CodeEntry (:doc "|macro to extend existing record with new values in pairs, internally using &record:with which takes flattern items")
          :code $ quote
            defmacro record-with (record & pairs) (; "check if args are in pairs")
              if
                not $ and (list? pairs)
                  every? pairs $ fn (xs)
                    and (list? xs)
                      &= 2 $ count xs
                raise $ str-spaced "|record-with expects a list of pairs (each with exactly two elements), got:" pairs
              ; "call &record:with"
              quasiquote $ &record:with ~record
                ~@ $ &list:concat & pairs
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |record? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a struct-based record (created with defstruct + %{}).")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= false
              record? $ {} (:x 1)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |recur $ %{} :CodeEntry (:doc "|internal function for tail recursion\nSyntax: (recur args...)\nParams: args (any, variable number)\nReturns: recur structure for tail call optimization\nEnables tail call optimization by marking recursive calls") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |reduce $ %{} :CodeEntry (:doc "|Collection reduction operation\nFunction: Reduces a collection using a specified function, accumulating elements onto an initial value\nParams: xs (collection), x0 (initial accumulator value), f (reduction function that takes accumulator and current element)\nReturns: any type - final accumulated result\nNotes: The reduction function f should accept two parameters (accumulator, current element) and return a new accumulator value")
          :code $ quote
            defn reduce (xs x0 f) (foldl xs x0 f)
          :examples $ []
            quote $ assert= 6
              reduce ([] 1 2 3) 0 +
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic :fn
        |ref? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn ref? (x)
              &= (type-of x) :ref
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |remove-watch $ %{} :CodeEntry (:doc "|internal function for removing atom watchers\nSyntax: (remove-watch atom key)\nParams: atom (atom), key (any)\nReturns: atom\nRemoves watcher with specified key from atom")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :unit)
              :args $ [] :ref :dynamic
        |repeat $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn repeat (x n0)
              apply-args
                  []
                  , n0
                defn %repeat (acc n)
                  hint-fn $ {}
                    :generics $ [] 'T
                    :args $ []
                      :: 'acc $ :: :list 'T
                      :: 'n :number
                    :return $ :: :list 'T
                  if (&<= n 0) acc $ recur (append acc x) (&- n 1)
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] 'T :number
              :generics $ [] 'T
              :return $ :: :list 'T
        |reset! $ %{} :CodeEntry (:doc "|internal syntax for resetting atom values\nSyntax: (reset! atom new-value)\nParams: atom (atom reference), new-value (any)\nReturns: new value\nSets atom to new value and returns it")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ ; reset! *my-atom
              {} $ :a 2
          :schema $ :: :fn
            {} (:return 'T)
              :args $ [] (:: :ref 'T) 'T
              :generics $ [] 'T
        |rest $ %{} :CodeEntry (:doc "|Returns the collection without its first element\nNil input returns nil; lists delegate to &list:rest.")
          :code $ quote
            defn rest (x)
              if (nil? x) nil $ if (list? x) (&list:rest x) (.rest x)
          :examples $ []
            quote $ assert= ([] 2 3)
              rest $ [] 1 2 3
            quote $ assert= nil (rest nil)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |result:map $ %{} :CodeEntry (:doc "|Mappable map implementation for Result")
          :code $ quote
            defn result:map (res f)
              tag-match res
                  :ok value
                  %:: (&tuple:enum res) :ok $ f value
                (:err err)
                  %:: (&tuple:enum res) :err err
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
                :: :fn $ {} (:return 'U)
                  :args $ [] 'T
              :generics $ [] 'T 'U
        |reverse $ %{} :CodeEntry (:doc "|Reverse the order of elements in a list")
          :code $ quote
            defn reverse (x) (&list:reverse x)
          :examples $ []
            quote $ assert= ([] 3 2 1)
              reverse $ [] 1 2 3
            quote $ assert= ([])
              reverse $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T)
              :generics $ [] 'T
              :return $ :: :list 'T
        |round $ %{} :CodeEntry (:doc "|internal function for rounding numbers\nSyntax: (round n)\nParams: n (number)\nReturns: number\nRounds number to nearest integer")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |round? $ %{} :CodeEntry (:doc "|internal function for checking if number is round\nSyntax: (round? n)\nParams: n (number)\nReturns: boolean\nReturns true if number has no fractional part")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :number
        |section-by $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn section-by (xs0 n)
              if (>= n 1)
                apply-args
                    []
                    , xs0
                  fn (acc xs)
                    if
                      &<= (&list:count xs) n
                      if (&list:empty? xs) acc $ append acc xs
                      recur
                        append acc $ take xs n
                        drop xs n
                raise $ str-spaced "|expected positive number, got:" n
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :dynamic :number
        |select-keys $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn select-keys (m xs)
              assert "|expected map for selecting" $ map? m
              foldl xs (&{})
                defn %select-keys (acc k)
                  hint-fn $ {}
                    :args $ [] :map :dynamic
                    :return :map
                  &map:assoc acc k $ &map:get m k
          :examples $ []
          :schema $ :: :fn
            {} (:return :map)
              :args $ [] :map :list
        |set? $ %{} :CodeEntry (:doc "|Check if a value is a set")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true
              set? $ #{} 1 2 3
            quote $ assert= false
              set? $ [] 1 2 3
            quote $ assert= false
              set? $ {} (:a 1)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |sin $ %{} :CodeEntry (:doc "|internal function for sine\nSyntax: (sin n)\nParams: n (number, radians)\nReturns: number\nReturns sine of angle in radians")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |slice $ %{} :CodeEntry (:doc "|Extract a slice from a collection from index n to m")
          :code $ quote
            defn slice (xs n ? m)
              if (nil? xs) nil $ if (list? xs) (&list:slice xs n m)
                if (string? xs) (&str:slice xs n m) (.slice xs n m)
          :examples $ []
            quote $ assert= ([] 2 3)
              slice ([] 1 2 3 4) 1 3
            quote $ assert= ([] 3 4)
              slice ([] 1 2 3 4) 2
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :number (:: :optional :number)
        |some-in? $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn some-in? (x path)
              if (nil? x) false $ list-match path
                () true
                (k ps)
                  if (map? x)
                    if (contains? x k)
                      recur (get x k) ps
                      , false
                    if (list? x)
                      if (number? k)
                        recur (get x k) ps
                        , false
                      raise $ &str:concat "|Unknown structure for some-in? detection: " x
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic :list
        |some? $ %{} :CodeEntry (:doc "|Complement of nil?\nReturns true when the value is not nil.")
          :code $ quote
            defn some? (x)
              not $ nil? x
          :examples $ []
            quote $ assert= true (some? 0)
            quote $ assert= false (some? nil)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |sort $ %{} :CodeEntry (:doc "|internal function for sorting lists\nSyntax: (sort list) or (sort list comparator)\nParams: list (list), comparator (function, optional)\nReturns: list\nReturns sorted list using natural order or custom comparator")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :list (:: :optional :fn)
        |split $ %{} :CodeEntry (:doc "|internal function for splitting strings\nSyntax: (split s delimiter)\nParams: s (string), delimiter (string)\nReturns: list of strings\nSplits string by delimiter into list of substrings")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :string :string
        |split-lines $ %{} :CodeEntry (:doc "|internal function for splitting lines\nSyntax: (split-lines s)\nParams: s (string)\nReturns: list of strings\nSplits string by newlines into list of lines")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :list)
              :args $ [] :string
        |sqrt $ %{} :CodeEntry (:doc "|internal function for square root\nSyntax: (sqrt n)\nParams: n (number)\nReturns: number\nReturns square root of n")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :number)
              :args $ [] :number
        |starts-with? $ %{} :CodeEntry (:doc "|internal function for checking string prefix\nSyntax: (starts-with? s prefix)\nParams: s (string), prefix (string)\nReturns: boolean\nReturns true if string starts with prefix")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :string :string
        |str $ %{} :CodeEntry (:doc "|converts values to string and concatenates them")
          :code $ quote
            defn str (x0 & xs)
              if (&list:empty? xs) (&str x0)
                &str:concat x0 $ str & xs
          :examples $ []
            quote $ assert= |hello (str |hello)
            quote $ assert= |abc (str |a |b |c)
            quote $ assert= |123 (str 1 2 3)
            quote $ assert= "|hello world" (str |hello "| " |world)
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :string)
              :args $ [] :dynamic
        |str-spaced $ %{} :CodeEntry (:doc "|converts values to string and joins them with spaces")
          :code $ quote
            defn str-spaced (& xs) (&str-spaced true & xs)
          :examples $ []
            quote $ assert= "|a b c" (str-spaced |a |b |c)
            quote $ assert= "|1 2 3" (str-spaced 1 2 3)
          :schema $ :: :fn
            {} (:rest :dynamic) (:return :string)
              :args $ []
        |string? $ %{} :CodeEntry (:doc "|checks if value is a string")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true (string? |hello)
            quote $ assert= false (string? 123)
            quote $ assert= false (string? :keyword)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |strip-prefix $ %{} :CodeEntry (:doc "|removes prefix from string if it starts with that prefix, returns original string otherwise")
          :code $ quote
            defn strip-prefix (s piece)
              if (starts-with? s piece)
                &str:slice s $ &str:count piece
                , s
          :examples $ []
            quote $ assert= "| world" (strip-prefix "|hello world" |hello)
            quote $ assert= |abc (strip-prefix |prefix-abc |prefix-)
            quote $ assert= |hello (strip-prefix |hello |xyz)
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :string
        |strip-suffix $ %{} :CodeEntry (:doc "|removes suffix from string if it ends with that suffix, returns original string otherwise")
          :code $ quote
            defn strip-suffix (s piece)
              if (ends-with? s piece)
                &str:slice s 0 $ &- (&str:count s) (&str:count piece)
                , s
          :examples $ []
            quote $ assert= |hello (strip-suffix "|hello world" "| world")
            quote $ assert= |abc (strip-suffix |abc-suffix |-suffix)
            quote $ assert= |hello (strip-suffix |hello |xyz)
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string :string
        |struct? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a struct definition.")
          :code $ quote
            defn struct? (x)
              &= (type-of x) :struct
          :examples $ []
            quote $ assert= true
              struct? $ defstruct Person (:name :string)
            quote $ assert= false
              struct? $ {} (:x 1)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |swap! $ %{} :CodeEntry (:doc "|Atomically updates a reference by applying a function to its current value and storing the result.")
          :code $ quote
            defmacro swap! (a f & args)
              quasiquote $ reset! ~a
                ~f (&atom:deref ~a) ~@args
          :examples $ []
            quote $ do (defatom *counter 0) (swap! *counter inc)
              assert= 1 $ deref *counter
            quote $ do (defatom *state 1) (swap! *state + 2)
              assert= 3 $ deref *state
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |symbol? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a symbol literal (as opposed to strings, keywords, or other data).")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true
              symbol? $ quote item
            quote $ assert= false (symbol? |text)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |syntax? $ %{} :CodeEntry (:doc "|detecting syntax element")
          :code $ quote
            defn syntax? (x)
              &= (type-of x) :syntax
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |tag-match $ %{} :CodeEntry (:doc "|Pattern matching on tagged tuples, dispatches based on the first element of the tuple")
          :code $ quote
            defmacro tag-match (value & body)
              if (&list:empty? body) (raise "|tag-match expected some patterns and matches")
                &let
                  t# $ gensym |tag
                  &let
                    v# $ gensym |v
                    quasiquote $ &let (~v# ~value)
                      if
                        not $ tuple? ~v#
                        raise $ str "|tag-match expected tuple, got" ~v#
                      &let
                        ~t# $ &tuple:nth ~v# 0
                        &tuple:validate-enum ~v# ~t#
                        internal/&tag-match-internal ~v# ~t# $ ~@ body
          :examples $ []
            quote $ assert= 11
              tag-match (:: :ok 1)
                  :ok v
                  &+ v 10
                (:err e) (eprintln e)
            quote $ assert= |got:hello
              tag-match (:: :some |hello)
                  :some x
                  str x |:got
                (:none) |nothing
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |tag? $ %{} :CodeEntry (:doc "|Check if a value is a tag (keyword)")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true (tag? :keyword)
            quote $ assert= false (tag? |string)
            quote $ assert= false (tag? 123)
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |tagging-edn $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn tagging-edn (data)
              if (list? data) (map data tagging-edn)
                if (map? data)
                  map-kv data $ defn %tagging (k v)
                    []
                      if (string? k) (turn-tag k) k
                      tagging-edn v
                  , data
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |take $ %{} :CodeEntry (:doc "|Take the first n elements from a list")
          :code $ quote
            defn take (xs n)
              if
                >= n $ &list:count xs
                , xs $ slice xs 0 n
          :examples $ []
            quote $ assert= ([] 1 2)
              take ([] 1 2 3 4) 2
            quote $ assert= ([] 1 2 3)
              take ([] 1 2 3) 5
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) :number
              :generics $ [] 'T
              :return $ :: :list 'T
        |take-last $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn take-last (xs n)
              if
                >= n $ &list:count xs
                , xs $ slice xs
                  - (&list:count xs) n
                  &list:count xs
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'T) :number
              :generics $ [] 'T
              :return $ :: :list 'T
        |thread-as $ %{} :CodeEntry (:doc "|a alias for `->%`") (:schema :dynamic)
          :code $ quote
            defmacro thread-as (& xs)
              if (&list:empty? xs) (raise "|thread-as expects at least 1 expression")
              quasiquote $ ->% ~@xs
          :examples $ []
        |thread-first $ %{} :CodeEntry (:doc "|a alias for `->`") (:schema :dynamic)
          :code $ quote
            defmacro thread-first (& xs)
              if (&list:empty? xs) (raise "|thread-first expects at least 1 expression")
              quasiquote $ -> ~@xs
          :examples $ []
        |thread-last $ %{} :CodeEntry (:doc "|a alias for `->>`") (:schema :dynamic)
          :code $ quote
            defmacro thread-last (& xs)
              if (&list:empty? xs) (raise "|thread-last expects at least 1 expression")
              quasiquote $ ->> ~@xs
          :examples $ []
        |thread-step? $ %{} :CodeEntry (:doc "|Check whether a value is a valid thread-macro step form")
          :code $ quote
            defn thread-step? (x)
              or (symbol? x) (tag? x)
                = (type-of x) :method
                = (type-of x) :fn
          :examples $ []
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |to-lispy-string $ %{} :CodeEntry (:doc "|internal function for converting to Lisp string\nSyntax: (to-lispy-string value)\nParams: value (any)\nReturns: string\nConverts value to Lisp-style string representation")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |to-pairs $ %{} :CodeEntry (:doc "|internal function for converting to pairs\nSyntax: (to-pairs map)\nParams: map (map)\nReturns: set\nConverts map to an unordered set of [key value] pairs")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :set)
              :args $ [] :map
        |trim $ %{} :CodeEntry (:doc "|internal function for trimming strings\nSyntax: (trim s)\nParams: s (string)\nReturns: string\nRemoves whitespace from beginning and end of string")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :string
        |try $ %{} :CodeEntry (:doc "|internal syntax for try-catch error handling\nSyntax: (try body (catch error handler))\nParams: body (expression), error (symbol), handler (expression)\nReturns: result of body or handler if error occurs\nProvides exception handling mechanism") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |tuple? $ %{} :CodeEntry (:doc "|Predicate that checks whether a value is a tuple literal created with the `::` form.")
          :code $ quote &runtime-implementation
          :examples $ []
            quote $ assert= true
              tuple? $ :: :a :b
            quote $ assert= false
              tuple? $ [] :a :b
          :schema $ :: :fn
            {} (:return :bool)
              :args $ [] :dynamic
        |turn-str $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn turn-str (x) (turn-string x)
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |turn-string $ %{} :CodeEntry (:doc "|internal function for converting to string\nSyntax: (turn-string value)\nParams: value (any)\nReturns: string\nConverts value to string representation")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :string)
              :args $ [] :dynamic
        |turn-symbol $ %{} :CodeEntry (:doc "|internal function for converting to symbol\nSyntax: (turn-symbol value)\nParams: value (string, tag, or symbol)\nReturns: symbol\nConverts string, tag, or existing symbol to symbol type")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic
        |turn-tag $ %{} :CodeEntry (:doc "|internal function for converting to tag\nSyntax: (turn-tag value)\nParams: value (string, symbol, or tag)\nReturns: tag\nConverts string, symbol, or existing tag to tag type")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :dynamic
        |type-of $ %{} :CodeEntry (:doc "|internal function for getting type of value\nSyntax: (type-of value)\nParams: value (any)\nReturns: tag representing the type\nReturns type tag like :nil, :bool, :number, :string, :list, :map, :set, :fn, etc.")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :tag)
              :args $ [] :dynamic
        |union $ %{} :CodeEntry (:doc "|Returns the union of all sets")
          :code $ quote
            defn union (base & xs)
              reduce xs base $ fn (acc item) (&union acc item)
          :examples $ []
            quote $ assert= (#{} 1 2 3 4)
              union (#{} 1 2) (#{} 3 4)
            quote $ assert= (#{} 1 2 3)
              union (#{} 1) (#{} 2) (#{} 3)
          :schema $ :: :fn
            {} (:rest :set) (:return :set)
              :args $ [] :set
        |unselect-keys $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn unselect-keys (m xs)
              assert "|expected map for unselecting" $ map? m
              foldl xs m $ defn %unselect-keys (acc k)
                hint-fn $ {}
                  :args $ [] (:: :map 'K 'V) 'K
                  :return $ :: :map 'K 'V
                &map:dissoc acc k
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :map 'K 'V) (:: :list 'K)
              :generics $ [] 'K 'V
              :return $ :: :map 'K 'V
        |update $ %{} :CodeEntry (:doc "|Applies a function to the value at a given key or index, returning a collection with the updated slot.")
          :code $ quote
            defn update (x k f)
              if (map? x)
                if (contains? x k)
                  assoc x k $ f (&map:get x k)
                  , x
                if (list? x)
                  if (&list:contains? x k)
                    assoc x k $ f (&list:nth x k)
                    , x
                  if (tuple? x)
                    assoc x k $ f (&tuple:nth x k)
                    if (record? x)
                      if (contains? x k)
                        assoc x k $ f (&record:get x k)
                        , x
                      raise $ &str:concat "|Cannot update key on item: " (to-lispy-string x)
          :examples $ []
            quote $ assert=
              {} $ :count 2
              update
                {} $ :count 1
                , :count inc
            quote $ assert= (:: 0 2 2)
              update (:: 0 1 2) 1 inc
            quote $ assert=
              {} $ :count 1
              update
                {} $ :count 1
                , :missing inc
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :dynamic
                :: :fn $ {} (:return 'T)
                  :args $ [] 'T
              :generics $ [] 'T
        |update-in $ %{} :CodeEntry (:doc "|Walks a path of keys inside nested maps/lists and applies a function to the value, creating intermediate maps as needed.")
          :code $ quote
            defn update-in (data path f)
              list-match path
                () $ f data
                (p0 ps)
                  assoc
                    either data $ {}
                    , p0 $ update-in (get data p0) ps f
          :examples $ []
            quote $ assert=
              {} $ :a
                {} $ :b 2
              update-in
                {} $ :a
                  {} $ :b 1
                [] :a :b
                , inc
            quote $ assert=
              {} $ :profile
                {} $ :visits 1
              update-in {} ([] :profile :visits)
                fn (_missing) 1
            quote $ assert=
              {} $ :x 10
              update-in
                {} $ :x 5
                [] :x
                fn (v) (&* v 2)
          :schema $ :: :fn
            {} (:return :dynamic)
              :args $ [] :dynamic :list
                :: :fn $ {} (:return 'T)
                  :args $ [] 'T
              :generics $ [] 'T
        |vals $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn vals (x)
              map (to-pairs x) last
          :examples $ []
            quote $ assert= (#{} 1 2)
              vals $ {} (:a 1) (:b 2)
            quote $ assert= (#{})
              vals $ {}
          :schema $ :: :fn
            {} (:return :set)
              :args $ [] :map
        |w-js-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro w-js-log (x)
              if (list? x)
                &let
                  v $ if
                    = :eval $ &get-calcit-running-mode
                    gensym |v
                    , '_log_tmp
                  quasiquote $ &let (~v ~x)
                    js/console.log
                      format-to-lisp $ quote ~x
                      , |=> ~v
                    ~ v
                quasiquote $ &let ()
                  js/console.log
                    format-to-lisp $ quote ~x
                    , |=> ~x
                  ~ x
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |w-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro w-log (x)
              &let
                v $ if
                  = :eval $ &get-calcit-running-mode
                  gensym |v
                  , '_log_tmp
                if (list? x)
                  quasiquote $ &let (~v ~x)
                    println
                      format-to-lisp $ quote ~x
                      , |=> ~v
                    ~ v
                  quasiquote $ &let ()
                    println
                      format-to-lisp $ quote ~x
                      , |=> ~x
                    ~ x
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |when $ %{} :CodeEntry (:doc "|Conditional macro that evaluates its body only when the test expression is truthy, returning the last body value.")
          :code $ quote
            defmacro when (condition & body)
              if (&list:empty? body) (raise "|when expects at least 1 body expression")
              if
                &= 1 $ &list:count body
                quasiquote $ if ~condition
                  ~ $ nth body 0
                quasiquote $ if ~condition
                  &let () ~@body
          :examples $ []
            quote $ assert= 4
              when (&> 3 2) (inc 3)
            quote $ assert= nil
              when false $ inc 1
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |when-let $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro when-let (pair & body)
              if
                not $ and (list? pair)
                  &= 2 $ count pair
                raise $ str-spaced "|expected a pair, got:" pair
              &let
                x $ nth pair 0
                if
                  not $ symbol? x
                  raise $ str-spaced "|expected a symbol for var name, got:" x
                quasiquote $ &let
                  ~x $ ~ (nth pair 1)
                  if (some? ~x)
                    do $ ~@ body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |when-not $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro when-not (condition & body)
              if (&list:empty? body) (raise "|when-not expects at least 1 body expression")
              if
                &= 1 $ &list:count body
                quasiquote $ if (not ~condition)
                  ~ $ nth body 0
                quasiquote $ if (not ~condition)
                  &let () ~@body
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |with-cpu-time $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro with-cpu-time (x)
              let
                  started $ gensym |started
                  v $ gensym |v
                quasiquote $ let
                    ~started $ cpu-time
                    ~v ~x
                  println |[cpu-time]
                    format-to-lisp $ quote ~x
                    , |=>
                      .format
                        &- (cpu-time) ~started
                        , 3
                      , |ms
                  ~ v
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |with-gensyms $ %{} :CodeEntry (:doc "|Macro helper for hygienic local names\nSyntax: (with-gensyms (a b ...) body...)\nBinds each symbol to a fresh gensym and evaluates body with those bindings.")
          :code $ quote
            defmacro with-gensyms (names & body)
              assert "|with-gensyms expects a list of symbols" $ and (list? names) (every? names symbol?)
              reduce (reverse names)
                quasiquote $ do (~@ body)
                fn (acc n)
                  quasiquote $ let
                      ~n $ gensym
                    , ~acc
          :examples $ []
            quote $ with-gensyms (v)
              quasiquote $ &let (~v 1) ~v
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |wo-js-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro wo-js-log (x) x
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |wo-log $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro wo-log (x) x
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |write-file $ %{} :CodeEntry (:doc "|internal function for writing files\nSyntax: (write-file filepath content)\nParams: filepath (string), content (string)\nReturns: nil or error\nWrites string content to file, creates directories if needed")
          :code $ quote &runtime-implementation
          :examples $ []
          :schema $ :: :fn
            {} (:return :unit)
              :args $ [] :string :string
        |zipmap $ %{} :CodeEntry (:doc |)
          :code $ quote
            defn zipmap (xs0 ys0)
              apply-args
                  {}
                  , xs0 ys0
                fn (acc xs ys)
                  if
                    if (&list:empty? xs) true $ &list:empty? ys
                    , acc $ recur
                      &map:assoc acc (&list:first xs) (&list:first ys)
                      rest xs
                      rest ys
          :examples $ []
          :schema $ :: :fn
            {}
              :args $ [] (:: :list 'K) (:: :list 'V)
              :generics $ [] 'K 'V
              :return $ :: :map 'K 'V
        |{,} $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defmacro {,} (& body)
              &let
                xs $ &list:filter body
                  defn &{,} (x)
                    hint-fn $ {} (:return :bool)
                    not= x ',
                quasiquote $ pairs-map
                  section-by ([] ~@xs) 2
          :examples $ []
        |{} $ %{} :CodeEntry (:doc "|macro for creating hashmaps\nSyntax: ({} (:key value) ...)\nParams: pairs (key-value pairs)\nReturns: hashmap\nCreates a hashmap from key-value pairs")
          :code $ quote
            defmacro {} (& xs)
              if
                not $ every? xs
                  fn (pair)
                    and (list? pair)
                      &= 2 $ &list:count pair
                raise $ str "|{} expects pairs of lists with exactly two elements each, got: " xs
              &let
                ys $ &list:concat & xs
                quasiquote $ &{} ~@ys
          :examples $ []
            quote $ {} (:a 1) (:b 2)
            quote $ {} (:name |Alice) (:age 30)
          :schema $ :: :macro
            {} $ :args ([])
        |~ $ %{} :CodeEntry (:doc "|internal syntax for interpolating value in macro\nSyntax: (~ expr) inside quasiquote\nParams: expr (expression to evaluate)\nReturns: evaluated expression\nUnquotes expression inside quasiquote") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
        |~@ $ %{} :CodeEntry (:doc "|internal syntax for spreading interpolate value in macro\nSyntax: (~@ list-expr) inside quasiquote\nParams: list-expr (expression that evaluates to list)\nReturns: spliced list elements\nUnquotes and splices list elements inside quasiquote") (:schema :dynamic)
          :code $ quote &runtime-implementation
          :examples $ []
      :ns $ %{} :NsEntry (:doc "|built-in function and macros in `calcit.core`")
        :code $ quote
          ns calcit.core $ :require (calcit.internal :as internal)
    |calcit.internal $ %{} :FileEntry
      :defs $ {}
        |&core-add-list-impl $ %{} :CodeEntry (:doc "|Core trait impl for Add on list") (:schema :dynamic)
          :code $ quote
            def &core-add-list-impl $ &impl::new :&core-add-list-impl (:: :add &list:concat)
          :examples $ []
        |&core-add-number-impl $ %{} :CodeEntry (:doc "|Core trait impl for Add on number") (:schema :dynamic)
          :code $ quote
            def &core-add-number-impl $ &impl::new :&core-add-number-impl (:: :add &+)
          :examples $ []
        |&core-add-string-impl $ %{} :CodeEntry (:doc "|Core trait impl for Add on string") (:schema :dynamic)
          :code $ quote
            def &core-add-string-impl $ &impl::new :&core-add-string-impl (:: :add &str:concat)
          :examples $ []
        |&core-eq-impl $ %{} :CodeEntry (:doc "|Core trait impl for Eq") (:schema :dynamic)
          :code $ quote
            def &core-eq-impl $ &impl::new :&core-eq-impl (:: :eq? &=)
          :examples $ []
        |&core-len-list-impl $ %{} :CodeEntry (:doc "|Core trait impl for Len on list") (:schema :dynamic)
          :code $ quote
            def &core-len-list-impl $ &impl::new :&core-len-list-impl (:: :len &list:count)
          :examples $ []
        |&core-len-map-impl $ %{} :CodeEntry (:doc "|Core trait impl for Len on map") (:schema :dynamic)
          :code $ quote
            def &core-len-map-impl $ &impl::new :&core-len-map-impl (:: :len &map:count)
          :examples $ []
        |&core-len-set-impl $ %{} :CodeEntry (:doc "|Core trait impl for Len on set") (:schema :dynamic)
          :code $ quote
            def &core-len-set-impl $ &impl::new :&core-len-set-impl (:: :len &set:count)
          :examples $ []
        |&core-len-string-impl $ %{} :CodeEntry (:doc "|Core trait impl for Len on string") (:schema :dynamic)
          :code $ quote
            def &core-len-string-impl $ &impl::new :&core-len-string-impl (:: :len &str:count)
          :examples $ []
        |&core-mappable-list-impl $ %{} :CodeEntry (:doc "|Core trait impl for Mappable on list") (:schema :dynamic)
          :code $ quote
            def &core-mappable-list-impl $ &impl::new :&core-mappable-list-impl (:: :map &list:map)
          :examples $ []
        |&core-mappable-map-impl $ %{} :CodeEntry (:doc "|Core trait impl for Mappable on map") (:schema :dynamic)
          :code $ quote
            def &core-mappable-map-impl $ &impl::new :&core-mappable-map-impl (:: :map &map:map)
          :examples $ []
        |&core-multiply-number-impl $ %{} :CodeEntry (:doc "|Core trait impl for Multiply on number") (:schema :dynamic)
          :code $ quote
            def &core-multiply-number-impl $ &impl::new :&core-multiply-number-impl (:: :multiply &*)
          :examples $ []
        |&core-show-impl $ %{} :CodeEntry (:doc "|Core trait impl for Show") (:schema :dynamic)
          :code $ quote
            def &core-show-impl $ &impl::new :&core-show-impl (:: :show &str)
          :examples $ []
        |&field-match-internal $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro &field-match-internal (value & body)
              if (&list:empty? body)
                quasiquote $ eprintln "|[Warn] field-match found no matched case, missing `_` case?" ~value
                &let
                  pair $ first body
                  if
                    not $ list? pair
                    raise $ str-spaced "|field-match expected arm in list, got:" pair
                  let
                      pattern $ &list:nth pair 0
                    assert "|expected literal or symbol as tag" $ or (tag? pattern) (symbol? pattern)
                    if (&= pattern '_)
                      &let ()
                        assert "|field-match expected a branch after `_`" $ &= 2 (&list:count pair)
                        if
                          not $ &= 1 (&list:count body)
                          eprintln "|[Warn] expected `_` beginning last branch of field-match"
                        &list:nth pair 1
                      &let ()
                        assert "|field-match expected an with (tag new-name body)" $ &= 3 (&list:count pair)
                        quasiquote $ if
                          &= ~pattern $ &map:get ~value :tag
                          &let
                              ~ $ &list:nth pair 1
                              , ~value
                            ~ $ &list:nth pair 2
                          &field-match-internal ~value $ ~@ (&list:rest body)
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic)
        |&tag-match-internal $ %{} :CodeEntry (:doc |)
          :code $ quote
            defmacro &tag-match-internal (value t & body)
              if (&list:empty? body)
                quasiquote $ raise (str-spaced "|tag-match found no matched case, missing `_` for" ~value)
                &let
                  pair $ &list:first body
                  if
                    not $ and (list? pair)
                      &= 2 $ &list:count pair
                    raise $ str-spaced "|tag-match expected pairs, got:" pair
                  let
                      pattern $ &list:nth pair 0
                      branch $ &list:nth pair 1
                    if (list? pattern)
                      &let
                        k $ &list:first pattern
                        &let
                          size $ &list:count pattern
                          quasiquote $ if
                            if (identical? ~t ~k)
                              identical? ~size $ &tuple:count ~value
                              , false
                            let
                              ~ $ map-indexed (&list:rest pattern)
                                defn %tag-match (idx x)
                                  [] x $ quasiquote
                                    &tuple:nth ~value $ ~ (inc idx)
                              , ~branch
                            &tag-match-internal ~value ~t $ ~@ (&list:rest body)
                      if (&= pattern '_) branch $ raise (str-spaced "|unknown supported pattern:" pair)
          :examples $ []
          :schema $ :: :macro
            {} $ :args ([] :dynamic :dynamic)
        |normalize-trait-type $ %{} :CodeEntry (:doc |) (:schema :dynamic)
          :code $ quote
            defn normalize-trait-type (t0)
              if (list? t0)
                &let
                  size $ &list:count t0
                  &let
                    head $ &list:first t0
                    &let
                      second $ if (&>= size 2) (&list:nth t0 1) nil
                      &let
                        third $ if (&>= size 3) (&list:nth t0 2) nil
                        &let
                          wrap-list $ fn (x)
                            if (list? x) x $ [] x
                          if
                            and (tag? head) (&= head :fn) (&= size 3)
                            [] :fn ([]) (wrap-list second) (&list:nth t0 2)
                            if
                              and (tag? head) (&= head :fn) (&= size 4)
                              [] :fn (wrap-list second) (wrap-list third) (&list:nth t0 3)
                              if
                                and (tag? second) (&= second :fn) (&= size 4)
                                [] head second ([]) (wrap-list third) (&list:nth t0 3)
                                if
                                  and (tag? second) (&= second :fn) (&= size 5)
                                  [] head second (wrap-list third)
                                    wrap-list $ &list:nth t0 3
                                    &list:nth t0 4
                                  , t0
                , t0
          :examples $ []
      :ns $ %{} :NsEntry (:doc "|internal function and macros for `calcit.core`")
        :code $ quote
          ns calcit.internal $ :require