Decide one name, one meaning, and file the names that break it

This commit is contained in:
2026-09-25 18:15:21 +02:00
committed by Lillem4n
parent 068e2b73ca
commit 44a824ccf5
3 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ In [docs/decisions.md](docs/decisions.md):
- A typed column's calc is refused unless proven - A typed column's calc is refused unless proven
- `Column` carries text, not a Go value - `Column` carries text, not a Go value
- `hold` names what a draw is kept in, `draw` the draw itself - `hold` names what a draw is kept in, `draw` the draw itself
- A function may not spell a method; two types may - One name, one meaning
- The package stays flat - The package stays flat
- The performance gate asserts allocations, not wall-clock time - The performance gate asserts allocations, not wall-clock time
- Rows live in a TSV, the shape in JSON - Rows live in a TSV, the shape in JSON
+9 -6
View File
@@ -307,13 +307,16 @@ writes as the load check proved it; a `Value any` would hand every caller a type
Goal 2 wants a name to reach one unit, so a unit takes the stem of what it is, and a Goal 2 wants a name to reach one unit, so a unit takes the stem of what it is, and a
file the stem of the units it holds. file the stem of the units it holds.
## A function may not spell a method; two types may ## One name, one meaning
A call writes a method with its receiver and a function bare, so one name on both greps Two declarations of any kind — function, method, field, type — share a name only where
as one unit, which is the reaching cost goal 2 counts, while the receiver before a they name one thing: an interface's method, `Fake` on each template kind, a field
shared method name says which type answers. `TestNoFunctionSpellsAMethod` holds it. A holding what a same-named method returns, `renderScope.hold` answering with a `*hold`.
type is outside the rule: `renderScope.hold` answers with a `*hold`, so the two spell A bare function never shares a name with a method, since grep cannot tell a bare call
one unit, which no test can judge. from a method's; `TestNoFunctionSpellsAMethod` holds that, and review judges the rest,
which is meaning no test can see. Serves goal 2: names that tell the truth, and reaching
the unit behind a symptom without asking a person. Decided 2026-09-25 by Lilleman; valid
while goal 2 counts reading cost.
## The package stays flat ## The package stays flat
+5
View File
@@ -22,6 +22,11 @@ This round, in order:
- Hold only the `{token}` grammar's tests in `format_test.go`: move the helpers seven - Hold only the `{token}` grammar's tests in `format_test.go`: move the helpers seven
other test files use (`engine`, `parse`, `compiled`, `mustRender`) and the weight, other test files use (`engine`, `parse`, `compiled`, `mustRender`) and the weight,
recursion and path-navigation tests to files named for what they test. recursion and path-navigation tests to files named for what they test.
- Give `rows` and `field` one meaning each, per the decision "One name, one meaning":
`categoryFiles.rows` returns a TSV file name where `table.rows` counts rows, and
`formatOps.field` compiles a `{field}` token where `structFields.field` reads a Go
struct field. Rename every other shared name that names two things — `walk`,
`column`, `expr` and `of` included.
- Run the nine-seat panel again and file what it names here. - Run the nine-seat panel again and file what it names here.
### Data ### Data