Skip to content

[stack 16/20] spec(gazprea): remove struct field forbidden by struct's own rule - #127

Closed
Sir-NoChill wants to merge 1 commit into
fix/slice-boundsfrom
fix/struct-nesting
Closed

[stack 16/20] spec(gazprea): remove struct field forbidden by struct's own rule#127
Sir-NoChill wants to merge 1 commit into
fix/slice-boundsfrom
fix/struct-nesting

Conversation

@Sir-NoChill

Copy link
Copy Markdown
Collaborator

Origin: spec-patches/05-fix-struct-nesting.patch (backlog audit).

What

gazprea/spec/types/struct.rst — the Another example in Declaration violated two rules stated a paragraph earlier and elsewhere in the spec:

  1. struct-in-struct forbidden: the chapter opening says "Any type except tuple, another struct and streams may be stored within a struct", yet Another contained an s1 struct_field. Removed.
  2. string[N] is not a valid type spelling: per types/string.rst, strings have no size specifier. Changed string[256] strcharacter[256] str.
  3. type-name typo: prose said "Struct type s has three fields" — should be s1. Corrected.

The prose that enumerated Another's fields is updated to match (four → three named fields; struct_field dropped).

Audit — ambiguities for reviewer attention

  • string vs character[N]: patch prefers character[256] to model a fixed-length string-like field. If Gazprea does support sized strings elsewhere (or if the intent was a variable-length string with a bounding hint), the correct fix is different — either string (unsized) or a normative addition to the string chapter. Confirm which is intended.
  • struct-in-struct ban: if the "no nested structs" rule is actually intended to be relaxed (matching what the Another example suggested), the fix is the other direction — keep s1 struct_field and amend types.rst and the chapter opening. Reviewer's call which is normative.
  • Composes cleanly with #122 — that PR's new paragraph refers only to t1 and t2, not the removed struct_field.

Stack

Depends on #126; part of stack #121.

🤖 Backlog patch applied by Claude Code

The Another example nested a struct-typed field two paragraphs after the
rule banning struct fields, and used the undefined sized-string syntax
string[256] (strings have no size specifier per string.rst); the field
list and its prose now agree with both rules. Also corrects the 's' vs
's1' type-name slip in the same sentence.

Assisted-by: Agent (claude) <ai@blobfish.icu>
@Sir-NoChill Sir-NoChill changed the title [stack 16/19] spec(gazprea): remove struct field forbidden by struct's own rule [stack 16/20] spec(gazprea): remove struct field forbidden by struct's own rule Aug 21, 2026
@Sir-NoChill

Copy link
Copy Markdown
Collaborator Author

Collapsed into #139 — a single consolidated PR of the whole stack (all 40 commits preserved). The flagged questions from this PR are aggregated in #139's description; this branch and thread remain here for reference. Closing in favour of #139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant