[stack 18/20] spec(gazprea): specify the method-call surface - #129
Closed
Sir-NoChill wants to merge 1 commit into
Closed
[stack 18/20] spec(gazprea): specify the method-call surface#129Sir-NoChill wants to merge 1 commit into
Sir-NoChill wants to merge 1 commit into
Conversation
Sir-NoChill
force-pushed
the
fix/procedure-call-sites
branch
from
August 15, 2026 16:33
7a57054 to
0117ccf
Compare
Sir-NoChill
force-pushed
the
feat/method-calls
branch
from
August 15, 2026 16:33
370bc32 to
3c16acc
Compare
Method calls appeared throughout vector.rst and string.rst with no grammar, receiver rules, or purity story, string.rst used a concat method defined nowhere, and append's signature could not explain its own examples. Adds a Method Calls subsection (receiver must be a var vector/string variable; method-call statements; mutating methods on function-locals preserve purity), defines append's single-element vs element-wise disambiguation, renames concat to append, and replaces the ill-typed (v1 + v2).push(3) example (vector<integer> + vector<real[2]>) with one consistent with the array-slice TypeError rule. Assisted-by: Agent (claude) <ai@blobfish.icu>
Sir-NoChill
force-pushed
the
fix/procedure-call-sites
branch
from
August 21, 2026 19:00
0117ccf to
20fab59
Compare
Sir-NoChill
force-pushed
the
feat/method-calls
branch
from
August 21, 2026 19:00
3c16acc to
ffde84f
Compare
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Origin:
spec-patches/08-feat-method-calls.patch(backlog audit). Substantive normative addition — flagged for close review.What
Method calls appeared throughout
types/vector.rstandtypes/string.rstwith no grammar, receiver rules, or purity story;string.rstinvoked aconcatmethod defined nowhere; andappend's signature contradicted its own examples.types/vector.rst— new Method Calls subsection (labelsssec:vec_methods) covering:vectororstringvariable; arrays/slices/expression results have no methods (compile-timeTypeError).push,append):varreceiver, function-local when inside a function.append(x)disambiguated: single-element if promotable, otherwise element-wise; single-element wins ties.(v1 + v2).push(3)example (vector<integer> + vector<real[2]>) with(v1 + v1).push(3)illustrating the array-sliceTypeErrorrule.types/string.rst— cross-links to the newsssec:vec_methodsand states strings have exactly the vector method set. Renamedletters.concat("ef")→letters.append("ef").Audit — ambiguities for reviewer attention
This is the largest patch of the backlog and the only
feat:— it adds normative surface, not a fix. High-value ambiguities:x.len()wherexis a literal or a function result; if so, the receiver rule should widen to "any expression whose type isvector/string" and the(v1+v1).push(3)example needs a different justification.appendsingle-vs-element-wise tie-break: patch declares the single-element reading wins on ambiguity. This is a language design decision — reviewer should confirm this matches the reference implementation. The alternative tie-break (prefer element-wise, or reject ambiguous calls asTypeError) has different ergonomics.expressions.rstandstatements.rst. If procedure calls also stand alone (they do, incallstatements), the "only" needs qualifying.concat→appendrename: this is a breaking change for any existing test programs invokingconcat. If existing tests or the reference implementation still exposeconcatas an alias, that alias needs mentioning in the spec.Stack
Depends on #128; part of stack #121.
🤖 Backlog patch applied by Claude Code