hclang 0.30.0 → 0.31.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.
@@ -1279,6 +1279,30 @@ export const HC_SOURCES = new Map([
1279
1279
  " .absent (_ &| {.f _; ((kids &| {(_ === f) ? {[f]}}) = []) ? {[f]}});",
1280
1280
  " (absent = []) ? {B} : {A}};",
1281
1281
  "```",
1282
+ "**Gap**, `x.gap()`: the absolute value of the alternating sum of the Sizes of",
1283
+ "x's immediate children, `|Size(F₁) − Size(F₂) + Size(F₃) − …|`, read as a",
1284
+ "FrameCount. The empty Figure has Gap `0`, and each child contributes its",
1285
+ "existing Size with a sign that starts positive and flips child by child; Gap",
1286
+ "keeps the sum's size and drops its sign, so it is never negative. Nesting",
1287
+ "reaches a child only through that Size, never through its construction. Gap",
1288
+ "observes rather than constructs, so like Cells, Form and Text it leaves the",
1289
+ "class on purpose: the sum it folds can go negative where no Figure does, so it",
1290
+ "is read as a number rather than a tally (#445). It reads each child's Size the",
1291
+ "way the semiring examples do, as `(_.size()).children.#`, and folds those",
1292
+ "readings with native arithmetic without touching construction, so it never",
1293
+ "asserts arithmetic equations or actual closure: a zero Gap is an observed",
1294
+ "value, not a proof. `_^`",
1295
+ "names the receiver so the alternating fold can read the children in order; the",
1296
+ "fold subtracts the sum of the rest, which flips the sign of every later child,",
1297
+ "and the sign of the whole is dropped last",
1298
+ "```;",
1299
+ " .gap {.kids _^.children;",
1300
+ " .count {(_.size()).children.#};",
1301
+ " .tail {(_ && {(((_ .0) = .0) ? {[()]} : {[[__ .1]]}) .0}) &| {_}};",
1302
+ " .alt {.cs _; (cs = []) ? {0} : {(count (cs .0)) - (alt (tail cs))}};",
1303
+ " .signed (alt kids);",
1304
+ " (signed .< 0) ? {0 - signed} : {signed}};",
1305
+ "```",
1282
1306
  "**Form**, `x.form()`: the plain bracket tree of x, one bracket per Figure, the",
1283
1307
  "way 005.30c wrote Figures before they were a class. It keeps shape and order,",
1284
1308
  "and forgets identity and the methods",
@@ -1549,6 +1573,44 @@ export const HC_SOURCES = new Map([
1549
1573
  "; [A.withness [B], B.withness []] = [A, B]",
1550
1574
  "# <>",
1551
1575
  "```",
1576
+ "## Gap",
1577
+ "",
1578
+ "Gap reads the Sizes of a Figure's immediate children, folds them with",
1579
+ "alternating signs, `Size(F₁) − Size(F₂) + Size(F₃) − …`, starting positive, and",
1580
+ "drops the sign. It observes rather than constructs, so it answers a FrameCount,",
1581
+ "never negative, and the empty Figure has Gap `0`. One child is its",
1582
+ "own Size, so `A` and `U` both have Gap `0` because `U`'s one child `Z` has Size",
1583
+ "`0`, while a Figure holding `row2` has Gap `2`. Two children are the difference",
1584
+ "of their Sizes, whichever comes first",
1585
+ "```",
1586
+ "; [(A.gap()) = 0, (U.gap()) = 0, ((Figure [row2]).gap()) = 2, ((Figure [row2, row3]).gap()) = 1, ((Figure [row3, row2]).gap()) = 1]",
1587
+ "# [<>, <>, <>, <>, <>]",
1588
+ "```",
1589
+ "Each child contributes its existing Size, so nesting reaches a child only",
1590
+ "through that Size: a one-child Figure's Gap is that child's Size whatever its",
1591
+ "nesting, and `deep4` nests `row4` to Size 4. The minimal witness is three",
1592
+ "children of Sizes 2, 5 and 3, whose Gap is `0`; the Sizes come from ordinary",
1593
+ "Figures and `row5` is one of Size 5",
1594
+ "```",
1595
+ "; .row5 (Figure [U, U, U, U, U]);",
1596
+ "; [(row5.size()).children.# = 5, ((Figure [row2, row5, row3]).gap()) = 0, ((Figure [row4]).gap()) = 4]",
1597
+ "# [<>, <>, <>]",
1598
+ "; [((Figure [row2, row5, row3]).gap()) = (((row2.size()).children.#) - ((row5.size()).children.#) + ((row3.size()).children.#))]",
1599
+ "# [<>]",
1600
+ "```",
1601
+ "Order still matters: reordering the same three children can change Gap,",
1602
+ "and it is an observation only, never a claim that a Walk is closed",
1603
+ "```",
1604
+ "; [((Figure [row2, row3, row5]).gap()) = 4, ((Figure [row5, row2, row3]).gap()) = 6, ((Figure [row3, row2, row5]).gap()) = 6]",
1605
+ "# [<>, <>, <>]",
1606
+ "```",
1607
+ "A child's own Size decides its contribution, so a child built differently but of",
1608
+ "equal Size contributes the same, and construction, observation and",
1609
+ "interpretation stay apart: Gap reports a number, not a meaning",
1610
+ "```",
1611
+ "; [((Figure [deep4, row2, row3]).gap()) = ((Figure [row4, row2, row3]).gap()), ((Figure [Z, U]).gap()) = 1]",
1612
+ "# [<>, <>]",
1613
+ "```",
1552
1614
  "## The Fano plane",
1553
1615
  "",
1554
1616
  "Seven originals of identical form, each a fresh `Figure []`, and seven triples",
@@ -1 +1 @@
1
- export const VERSION = "0.30.0";
1
+ export const VERSION = "0.31.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hclang",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Homoiconic C command-line interpreter and REPL",
5
5
  "keywords": [
6
6
  "language",