hclang 0.21.1 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1069,8 +1069,12 @@ export const HC_SOURCES = new Map([
1069
1069
  "never affects `=`. Every observer answers a Figure, never a number or a",
1070
1070
  "Boolean: `A`, with no children, means no, and `B` means yes. So every answer can",
1071
1071
  "be a child, a receiver, or an argument, and the class is closed under its own",
1072
- "methods. Only Form and Text leave the class, on purpose: they answer a plain",
1073
- "bracket tree and its text, for reading a Figure rather than computing with it.",
1072
+ "methods. Only Cells, Form and Text leave the class, on purpose: Cells and Form",
1073
+ "answer a plain bracket tree and Text spells one, for reading a Figure rather",
1074
+ "than computing with it. A tally also reads as a natural number. Its children",
1075
+ "are an aggregate, so `(x.size()).children.#` is the FrameCount it spells and",
1076
+ "`x.children.#` counts x's children. A Figure's own `.#` and `.##` are `0`,",
1077
+ "because its children are a property rather than its elements (#407, #411).",
1074
1078
  "",
1075
1079
  "A method names its own Figure `_^`, because a bare name is looked up on the",
1076
1080
  "argument first (spec 7), and the argument is usually another Figure. For the",
@@ -1104,21 +1108,35 @@ export const HC_SOURCES = new Map([
1104
1108
  " .size {.kids _^.children;",
1105
1109
  " (kids = U.children) ? {Figure [U]} : {((kids & {_.size()}) | (Tally Z)).row}};",
1106
1110
  "```",
1111
+ "**Cells**, `x.cells()`: the bracket tree of x with `1` in place of each cell,",
1112
+ "so `(x.cells()).##` is the Size of x as a natural number, counted without",
1113
+ "joining a tally. A count is its own size, so the `1` of a unit is already its",
1114
+ "count. It keeps the cell count and where the cells are, and forgets identity.",
1115
+ "The unit case comes first, as in Size",
1116
+ "```;",
1117
+ " .cells {.kids _^.children;",
1118
+ " (kids = U.children) ? {1} : {kids & {_.cells()}}};",
1119
+ "```",
1107
1120
  "**Multiplication**, `x.mul y`: y once for every cell of x, and `Z` when y is",
1108
1121
  "`Z`. It keeps y's identity in every position and forgets x's shape",
1109
1122
  "```;",
1110
- " .mul {.y _; .cells ((_^.size()).children);",
1111
- " (y = Z) ? {Z} : {Figure (cells & {y})}};",
1123
+ " .mul {.y _; .units ((_^.size()).children);",
1124
+ " (y = Z) ? {Z} : {Figure (units & {y})}};",
1112
1125
  "```",
1113
1126
  "**Tally multiplication**, `x.size_mul y`: the Size of a Figure holding y once",
1114
- "per child of x. It keeps the cell count and forgets both shapes",
1127
+ "per child of x, and `Z` when y is `Z`, as in Multiplication: one row of",
1128
+ "nothing, `Figure [Z]`, has the form of `U` and would count as a cell. It keeps",
1129
+ "the cell count and forgets both shapes",
1115
1130
  "```;",
1116
- " .size_mul {.y _; (Figure (_^.children & {y})).size()};",
1131
+ " .size_mul {.y _; .kids _^.children;",
1132
+ " (y = Z) ? {Z} : {(Figure (kids & {y})).size()}};",
1117
1133
  "```",
1118
1134
  "**Size-equivalence**, `x.size_equivalent y`: `U` when the two Sizes agree and",
1119
- "`Z` otherwise. It keeps only whether the cell counts agree",
1135
+ "`Z` otherwise. It compares the two cell counts as natural numbers, which",
1136
+ "agree exactly when the two tallies do, so it joins no tally. It keeps only",
1137
+ "whether the cell counts agree",
1120
1138
  "```;",
1121
- " .size_equivalent {((_^.size()) = (_.size())) ? {U} : {Z}};",
1139
+ " .size_equivalent {(((_^.cells()).##) = ((_.cells()).##)) ? {U} : {Z}};",
1122
1140
  "```",
1123
1141
  "**Sameness of form**, `x.sameform y`: `B` when `x = y`. It compares child by",
1124
1142
  "child and forgets identity and reuse",
@@ -1229,6 +1247,21 @@ export const HC_SOURCES = new Map([
1229
1247
  "; ((two_fours.size()).size()) = (two_fours.size())",
1230
1248
  "# <>",
1231
1249
  "```",
1250
+ "A tally reads as a natural number, because its children are an aggregate and",
1251
+ "`.#` counts them. A Figure's own `.#` and `.##` are `0`: its children are a",
1252
+ "property, not its elements, and `.##` counts only what is not an aggregate",
1253
+ "```",
1254
+ "; [E.children.#, (E.many()).children.#, (two_fours.size()).children.#, E.#, E.##, E.children.##] = [2, 2, 8, 0, 0, 0]",
1255
+ "# <>",
1256
+ "```",
1257
+ "Cells marks where the cells are, and `.##` counts them as Size does. A count",
1258
+ "is its own size, as a tally is its own Size",
1259
+ "```",
1260
+ "; [(E.cells()) = [[], 1], (deep4.cells()) = [[[[1, 1, 1, 1]]]], (Z.cells()) = [], (U.cells()) = 1]",
1261
+ "# [<>, <>, <>, <>]",
1262
+ "; [(two_fours.cells()).##, (deep4.cells()).##, ((two_fours.cells()).##).##, (two_fours.size()).children.#] = [8, 4, 8, 8]",
1263
+ "# <>",
1264
+ "```",
1232
1265
  "## The semiring",
1233
1266
  "",
1234
1267
  "The carrier is not raw Figures. Let `F` be the finite, well-founded Figures,",
@@ -1256,6 +1289,11 @@ export const HC_SOURCES = new Map([
1256
1289
  "```",
1257
1290
  "; [((Figure [row2, row3]).size()) = (Figure [U, U, U, U, U]), (rectangle23.size()) = ((row2.size()).size_mul (row3.size()))]",
1258
1291
  "# [<>, <>]",
1292
+ "```",
1293
+ "At a zero factor both recipes answer `Z`, a one-cell factor included",
1294
+ "```",
1295
+ "; [(U.size_mul Z) = Z, ((Figure [U]).size_mul Z) = Z, ((U.mul Z).size()) = ((U.size()).size_mul (Z.size()))]",
1296
+ "# [<>, <>, <>]",
1259
1297
  "; .deep2 (Figure [Figure [row2]]); .deep3 (Figure [Figure [Figure [row3]]]);",
1260
1298
  "; [row2.size_equivalent deep2, row3.size_equivalent deep3, (Figure [row2, row3]).size_equivalent (Figure [deep2, deep3]), (row2.mul row3).size_equivalent (deep2.mul deep3)] = [U, U, U, U]",
1261
1299
  "# <>",
@@ -1270,6 +1308,12 @@ export const HC_SOURCES = new Map([
1270
1308
  "# [(), <>]",
1271
1309
  "; [(Figure [Z, row2]).size_equivalent row2, (Figure [row2, Z]).size_equivalent row2, (U.mul row2).size_equivalent row2, (row2.mul U).size_equivalent row2] = [U, U, U, U]",
1272
1310
  "# <>",
1311
+ "```",
1312
+ "Read as natural numbers, Size takes construction to `+` and multiplication to",
1313
+ "`*`, so the same laws hold of FrameCount arithmetic, where they are native",
1314
+ "```",
1315
+ "; [((Figure [row2, row3]).cells()).## = (((row2.cells()).##) + ((row3.cells()).##)), (rectangle23.cells()).## = (((row2.cells()).##) * ((row3.cells()).##))]",
1316
+ "# [<>, <>]",
1273
1317
  "; [(Figure [Figure [row2, row3], row4]).size_equivalent (Figure [row2, Figure [row3, row4]]), (Figure [row2, row3]).size_equivalent (Figure [row3, row2])] = [U, U]",
1274
1318
  "# <>",
1275
1319
  "; (((row2.mul row3).mul row4).size_equivalent (row2.mul (row3.mul row4))) = U",
@@ -1326,6 +1370,12 @@ export const HC_SOURCES = new Map([
1326
1370
  "; point_table = (originals.children & {.p _; originals.children & {(p === _) ? {Three} : {Figure [U]}}})",
1327
1371
  "# <>",
1328
1372
  "```",
1373
+ "Read as natural numbers, the table counts three on the diagonal and one",
1374
+ "everywhere else",
1375
+ "```",
1376
+ "; (point_table & {_ & {_.children.#}}) = (originals.children & {.p _; originals.children & {(p === _) ? {3} : {1}}})",
1377
+ "# <>",
1378
+ "```",
1329
1379
  "Dually, `meet` counts the originals two triples share: multiplying their two",
1330
1380
  "Withness marks leaves one cell exactly when both hold it. The two tables are",
1331
1381
  "equal, which is the plane's self-duality",
@@ -1366,7 +1416,7 @@ export const HC_SOURCES = new Map([
1366
1416
  "the scope that built it. The Fano plane above already binds `f`, the name",
1367
1417
  "Withness uses inside its blocks; these bind the other locals",
1368
1418
  "```",
1369
- "; .kids 9; .y 9; .cells 9; .found 9; .absent 9;",
1419
+ "; .kids 9; .y 9; .units 9; .cells 9; .found 9; .absent 9;",
1370
1420
  "; [(E.withness [A, B]) = B, (row2.mul row3) = rectangle23, (E.size()) = (Figure [U])]",
1371
1421
  "# [<>, <>, <>]",
1372
1422
  "```",
@@ -1 +1 @@
1
- export const VERSION = "0.21.1";
1
+ export const VERSION = "0.21.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hclang",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "description": "Homoiconic C command-line interpreter and REPL",
5
5
  "keywords": [
6
6
  "language",