hclang 0.41.1 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1491,34 +1491,78 @@ export const HC_SOURCES = new Map([
1491
1491
  "fourth hash and Star correspondence use; `d * k` now answers the same Demi",
1492
1492
  "through the operator below.",
1493
1493
  "",
1494
- "**Arithmetic**, `d + x`, `d - x`, `d * k` and `d / n` (015.02). A class answers",
1495
- "an operator by declaring a method under its name, found on the operand and its",
1494
+ "**Arithmetic**, `d + x`, `d - x` and `d * x` (015.11). A class answers an",
1495
+ "operator by declaring a method under its name, found on the operand and its",
1496
1496
  "declared parents, the chain its other methods come from, so an operator in a",
1497
1497
  "method body keeps its global meaning rather than recurring into the class that",
1498
- "is running. `+`, `-` and `*` **construct a fresh Demi state** from Size and",
1499
- "Count observations of their operands, keeping Figure 008's distinction between",
1500
- "construction and observation; `/` is the one that answers a Spin observation, a",
1501
- "number rather than a Demi. None of the four is application: none flips the",
1502
- "phase, and each answers a fresh value and leaves `d` as it was.",
1503
- "",
1504
- "- `d + x` deposits `x.##` on the **right**: `Demi [p, L, R + x.##]`. A sizeless",
1505
- " host's failure is the answer, as it is for application.",
1506
- "- `d - x` deposits on the **left**: `Demi [p, L + x.##, R]`. It is not",
1507
- " subtraction: a deposit only ever adds, so a load never goes negative and",
1508
- " stays a whole Count. Right deposition lowers the signed residual `L − R` and",
1509
- " left deposition raises it, the reverse of ordinary signed-scalar `+` and `-`.",
1510
- "- `d * k` scales both loads by an admissible Count k, `Demi [p, kL, kR]`, the",
1511
- " same rule as `scale_`, refusing a non-Count with `$!!.invalid-scale`.",
1512
- "- `d / n` observes Spin, the signed residual over a strictly positive Count,",
1513
- " `(L − R) / n`. It answers a number, not a Demi, and keeps the typed divisor:",
1514
- " a non-Count, including a negative, is a type error, and a zero divisor is",
1515
- " `$!.division-by-zero`.",
1498
+ "is running. All three **construct a fresh Demi state** from the one Size",
1499
+ "observation `x.##` of their operand, keeping Figure 008's distinction between",
1500
+ "construction and observation. They are **fixed-channel load transformations**",
1501
+ "on the two-load shadow, consistent with what a `RotorRouter`",
1502
+ "(`hc/rotor-router.hc`) does to its channel loads: `+` and `-` add `x.##` to one",
1503
+ "fixed channel's load the way a route adds a Frame's Size to the channel it lands",
1504
+ "in, and `*` is the Star shadow `scale_`. These are correspondences, not a claim",
1505
+ "that the Router declares named `+`, `-` or `*` methods: the Router declares only",
1506
+ "`apply_` (alternating route-and-flip), `.#`, `.##` and `.###` (its phase, total",
1507
+ "load and signed residual). None of the three Demi operators is application: none",
1508
+ "flips the phase, and each answers a fresh value and leaves `d` as it was.",
1509
+ "",
1510
+ "- `d + x` is the **tally** operator: it deposits `x.##` on the **right**,",
1511
+ " `Demi [p, L, R + x.##]`. This is the transformation a route into the router's",
1512
+ " right channel induces on the loads — that channel's load grows by the routed",
1513
+ " Frame's Size — but it targets a fixed channel without flipping the phase,",
1514
+ " rather than invoking the Router's alternating `apply_`. A sizeless host's",
1515
+ " failure is the answer, as it is for application.",
1516
+ "- `d - x` is the **alternator** operator: it deposits on the **left**,",
1517
+ " `Demi [p, L + x.##, R]`, the load transformation a route into the left channel",
1518
+ " induces. It is not subtraction: a deposit only ever adds, so a load never goes",
1519
+ " negative and stays a whole Count. Right deposition lowers the signed residual",
1520
+ " `L − R` and left deposition raises it, the reverse of ordinary signed-scalar",
1521
+ " `+` and `-`.",
1522
+ "- `d * x` is the **inlay** operator: it scales both loads by the operand's Size",
1523
+ " `x.##`, `Demi [p, sL, sR]` for `s = x.##`, keeping the phase. It reads the",
1524
+ " operand through the one Size observer, as `+` and `-` do, so any sized Frame",
1525
+ " scales a Demi, not only a bare Count. A sizeless host's failure is the answer,",
1526
+ " as it is for application. Because `x.##` is always a nonnegative whole Count",
1527
+ " when present, the loads stay whole Counts and the result is a valid Demi. It",
1528
+ " is literally `d.scale_ (x.##)`: `*` reads the Size, then hands it to `scale_`,",
1529
+ " which is the Star shadow (`(x * y).####` is `x.####.scale_ (y.##)` for a",
1530
+ " nonempty host x) and already takes a Size. Delegating to `scale_` builds the",
1531
+ " fresh Demi by a load-only functional update, never naming the `Demi`",
1532
+ " constructor inside the method, so a unit-taggable operand such as a decimal",
1533
+ " cannot shadow the constructor through the argument scope; `D * 2.5` scales by",
1534
+ " `(2.5).## = 2`.",
1516
1535
  "",
1517
1536
  "None of these is sequential application: `d x` deposits in the active channel",
1518
1537
  "and flips the phase, while `+`, `-` and `*` choose a channel explicitly and",
1519
1538
  "keep it. So `+` and `-` reach states a run cannot, a phase-2 Demi with a load",
1520
1539
  "on the odd side, and `*` is the Star shadow, not a repeated deposit.",
1521
1540
  "",
1541
+ "**No division (015.11).** A Demi declares **no** `/` operator. Division is not a",
1542
+ "Router construction: the router constructs tally, alternator and inlay — Count,",
1543
+ "residual and Size — and nothing in that native structure earns a quotient. The",
1544
+ "earlier signed-ratio `d / x` (015.02) and the Size-uniform `d / x` (015.09a)",
1545
+ "are both removed. There is no modular Spin, renamed quotient, `phase`, or other",
1546
+ "division surrogate in their place. A `D / x` now falls back to the global `/`",
1547
+ "operator (`lib/ops/math.ts`), which has no numeric meaning for a non-numeric",
1548
+ "Demi left operand and **answers nil**; it does **not** silently preserve a Demi",
1549
+ "signed quotient through another path. An operand that is already an error still",
1550
+ "propagates, left operand first, as it does for `+`, `-` and `*`. This removes",
1551
+ "only the Demi-specific operator: the global language `/` and `hc/figures.hc`'s",
1552
+ "`spin` observation (signed residual over a positive Count, on any host) are",
1553
+ "untouched.",
1554
+ "",
1555
+ "**Compatibility (015.11).** The three constructive operators `+`, `-` and `*`",
1556
+ "read their operand through the one Size observer `x.##`; `+` and `-` are",
1557
+ "unchanged from 015.02, and `*` keeps its 015.09a Size-uniform domain. `D * 3` is",
1558
+ "unchanged, because `3.## = 3`; a non-Count sized operand such as another Demi,",
1559
+ "an aggregate, or a decimal scales by its Size (`D * 2.5` scales by `2`, since",
1560
+ "`(2.5).## = 2`); and a sizeless operand propagates its own failure. `scale_` is",
1561
+ "unchanged and still takes a Count directly; `*` equals `d.scale_ (x.##)` for",
1562
+ "every sized `x`. The only removal is the Demi `/` operator: a call that",
1563
+ "previously answered a signed Spin, such as `D / 2`, is no longer a Demi",
1564
+ "operation.",
1565
+ "",
1522
1566
  "**Text.** A Demi prints as what it is, an aggregate of fields and methods, and",
1523
1567
  "that reads back as the same Demi. As text it reads `Demi(<>,12,3)`, with the",
1524
1568
  "phase spelled as the orientation it stands for.",
@@ -1546,10 +1590,8 @@ export const HC_SOURCES = new Map([
1546
1590
  " (s ~ (0.<>)) ? {Demi [p, l, (r + s)]} : {s}};",
1547
1591
  " .- {.s (_ .##); .p (_^ .phase); .l (_^ .left); .r (_^ .right);",
1548
1592
  " (s ~ (0.<>)) ? {Demi [p, (l + s), r]} : {s}};",
1549
- " .* {.k _; .p (_^ .phase); .l (_^ .left); .r (_^ .right);",
1550
- " (k ~ (0.<>)) ? {Demi [p, (l * k), (r * k)]} : {$!!.invalid-scale}};",
1551
- " ./ {.n <(1).<>> _; .signed (_^ .###);",
1552
- " (n .< 1) ? {signed / 0} : {signed / n}};",
1593
+ " .* {.s (_ .##);",
1594
+ " (s ~ (0.<>)) ? {(_^^ .scale_ s)} : {s}};",
1553
1595
  " .toText {“Demi(” (((_^ .phase) = 2) ? {“<>”} : {“()”}) “,” (_^ .left) “,” (_^ .right) “)”}",
1554
1596
  " ]} : {$!!.invalid-demi}} : {$!!.invalid-demi}};",
1555
1597
  "```",
@@ -1710,18 +1752,20 @@ export const HC_SOURCES = new Map([
1710
1752
  "```",
1711
1753
  "## Arithmetic",
1712
1754
  "",
1713
- "Four operators act on a Demi's state. `+`, `-` and `*` **construct a fresh",
1714
- "Demi** from observations of their operands: `+` deposits on the right and `-`",
1715
- "on the left, each by the operand's Size, keeping the phase, and `*` scales both",
1716
- "loads by a Count. `/` is the one observation among them: it observes Spin and",
1717
- "answers a number, not a Demi. Each answers a fresh value and leaves its operand",
1718
- "as it was, so they compose by nesting",
1755
+ "Three operators act on a Demi's state, each reading its operand through the one",
1756
+ "Size observer `x.##`. They are fixed-channel load transformations consistent",
1757
+ "with a `RotorRouter`'s channel loads (`hc/rotor-router.hc`), not named Router",
1758
+ "methods: the Router declares only `apply_`, `.#`, `.##` and `.###`. `+`, `-`",
1759
+ "and `*` **construct a fresh Demi** from observations of their operands: `+` is",
1760
+ "tally, depositing `x.##` on the right; `-` is alternator, depositing on the",
1761
+ "left; and `*` is inlay, scaling both loads by `x.##` through `scale_`, the Star",
1762
+ "shadow. Each keeps the phase, answers a fresh value and leaves its operand as it",
1763
+ "was, so they compose by nesting. There is **no** `/`: a Demi declares no",
1764
+ "division operator",
1719
1765
  "```",
1720
1766
  "; .D (Demi [2, 5, 3]);",
1721
1767
  "; [“” (D + 4), “” (D - 4), “” (D * 3)]",
1722
1768
  "# [“Demi(<>,5,7)”, “Demi(<>,9,3)”, “Demi(<>,15,9)”]",
1723
- "; [(D / 2), ((D + 4) / 2)]",
1724
- "# [1, -1]",
1725
1769
  "; [“” ((D + 4) - 2), “” ((D - 2) + 4), “” ((D + 4) * 3)]",
1726
1770
  "# [“Demi(<>,7,7)”, “Demi(<>,7,7)”, “Demi(<>,15,21)”]",
1727
1771
  "; “” D",
@@ -1755,20 +1799,23 @@ export const HC_SOURCES = new Map([
1755
1799
  "; [((D + 4) - 2) = ((D - 2) + 4), ((D + 4) * 3) = ((D * 3) + 12)]",
1756
1800
  "# [<>, <>]",
1757
1801
  "```",
1758
- "A sizeless host refuses, its failure the answer, as application refuses it.",
1759
- "`*` keeps the `scale_` domain, refusing a non-Count, and never flips to Star on",
1760
- "the aggregate. `/` keeps Spin's typed, strictly positive Count divisor: a",
1761
- "non-Count, a negative among them, is a type error, and a zero divisor is",
1762
- "division by zero, even for a zero residual",
1763
- "```",
1764
- "; [D + ([].nope), D - ([].nope)]",
1765
- "# [$!.name-missing “..., $!.name-missing “...]",
1766
- "; [D * (0 - 1), D * 2.5]",
1767
- "# [$!!.invalid-scale, $!!.invalid-scale]",
1768
- "; [D / 0, D / (0 - 1), D / 2.5]",
1769
- "# [$!.division-by-zero /, $!.type-error .n <(1).<>> -1, $!.type-error .n <(1).<>> 2.5]",
1770
- "; (Demi [2, 4, 4]) / 0",
1771
- "# $!.division-by-zero /",
1802
+ "A sizeless host refuses on all three operators, its failure the answer, as",
1803
+ "application refuses it. `*` reads its operand's Size rather than demanding a",
1804
+ "bare Count, so a Demi, an aggregate or a decimal works through its `.##`, while",
1805
+ "`D * 0` still annihilates",
1806
+ "```",
1807
+ "; [D + ([].nope), D - ([].nope), D * ([].nope)]",
1808
+ "# [$!.name-missing “..., $!.name-missing “..., $!.name-missing “...]",
1809
+ "```",
1810
+ "`*` scales by the operand's Size, so its domain is every sized Frame: a Demi",
1811
+ "contributes `L + R`, an aggregate its element count, a decimal its truncated",
1812
+ "magnitude, and a zero Size annihilates both loads. `D * 3` is unchanged, since",
1813
+ "`3.## = 3`, and the result keeps the phase in either parity",
1814
+ "```",
1815
+ "; [“” (D * (Demi [1, 2, 4])), “” (D * [[], []]), “” (D * 2.5), “” (D * 0)]",
1816
+ "# [“Demi(<>,30,18)”, “Demi(<>,10,6)”, “Demi(<>,10,6)”, “Demi(<>,0,0)”]",
1817
+ "; [“” (D * 1), (D * 3).#, (P * 3).#, “” (P * 3)]",
1818
+ "# [“Demi(<>,5,3)”, 2, 1, “Demi((),15,9)”]",
1772
1819
  "```",
1773
1820
  "The signed-scalar reading misleads: `+` lowers the residual and `-` raises it,",
1774
1821
  "so `D + 4` is not “larger” than `D`, and `D - 4` is not `D` made smaller",
@@ -1776,6 +1823,32 @@ export const HC_SOURCES = new Map([
1776
1823
  "; [(D + 4).### .< D.###, (D - 4).### .> D.###]",
1777
1824
  "# [<>, <>]",
1778
1825
  "```",
1826
+ "## No Demi division (015.11)",
1827
+ "",
1828
+ "A Demi declares **no** `/` operator: division is not a Router construction. A",
1829
+ "`D / x` is not a Demi operation at all; dispatch falls through to the global",
1830
+ "`/`, which has no numeric meaning for a non-numeric left operand and answers",
1831
+ "nil, never a signed quotient. A zero or a Demi divisor is nil the same way, so",
1832
+ "there is no hidden division-by-zero path and no Demi-as-Spin through another",
1833
+ "name. Only a failing operand changes the answer, because the global `/`",
1834
+ "propagates an operand that is already an error, exactly as `+`, `-` and `*` do",
1835
+ "```",
1836
+ "; .Dp (Demi [2, 3, 5]); .E (Demi [1, 2, 4]);",
1837
+ "; [D / 2, D / 4, Dp / 2, D / E]",
1838
+ "# [(), (), (), ()]",
1839
+ "; [D / 0, (Demi [2, 4, 4]) / 0, D / (0 - 4), D / 2.5]",
1840
+ "# [(), (), (), ()]",
1841
+ "; D / ([].nope)",
1842
+ "# $!.name-missing “...",
1843
+ "```",
1844
+ "The global language `/` and the `spin` observation in `hc/figures.hc` are",
1845
+ "untouched: `spin` still answers the signed residual over a positive Count on",
1846
+ "any host, and a plain numeric `/` still divides. Removing the Demi operator",
1847
+ "removes only the Demi-specific division",
1848
+ "```",
1849
+ "; [“” (6 / 2), (D.### / 2) = 1]",
1850
+ "# [“3”, <>]",
1851
+ "```",
1779
1852
  "## A precise regression: a load read at the wrong depth",
1780
1853
  "",
1781
1854
  "Carets count lexically, so inside a branch `_^` is the method's own scope, not",
@@ -1 +1 @@
1
- export const VERSION = "0.41.1";
1
+ export const VERSION = "0.42.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hclang",
3
- "version": "0.41.1",
3
+ "version": "0.42.0",
4
4
  "description": "Homoiconic C command-line interpreter and REPL",
5
5
  "keywords": [
6
6
  "language",