Decide one name, one meaning, and file the names that break it
This commit is contained in:
@@ -64,7 +64,7 @@ In [docs/decisions.md](docs/decisions.md):
|
||||
- A typed column's calc is refused unless proven
|
||||
- `Column` carries text, not a Go value
|
||||
- `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 performance gate asserts allocations, not wall-clock time
|
||||
- Rows live in a TSV, the shape in JSON
|
||||
|
||||
+9
-6
@@ -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
|
||||
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
|
||||
as one unit, which is the reaching cost goal 2 counts, while the receiver before a
|
||||
shared method name says which type answers. `TestNoFunctionSpellsAMethod` holds it. A
|
||||
type is outside the rule: `renderScope.hold` answers with a `*hold`, so the two spell
|
||||
one unit, which no test can judge.
|
||||
Two declarations of any kind — function, method, field, type — share a name only where
|
||||
they name one thing: an interface's method, `Fake` on each template kind, a field
|
||||
holding what a same-named method returns, `renderScope.hold` answering with a `*hold`.
|
||||
A bare function never shares a name with a method, since grep cannot tell a bare call
|
||||
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
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ This round, in order:
|
||||
- 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,
|
||||
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.
|
||||
|
||||
### Data
|
||||
|
||||
Reference in New Issue
Block a user