feat(runtime): invoke an operation with a positional argument list - #462
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
force-pushed
the
feature/positional-invoke-arguments
branch
from
September 20, 2026 19:54
f2e3521 to
c6214f2
Compare
devin-ai-integration
Bot
changed the base branch from
develop
to
docs/protocol-state-machines-design
September 20, 2026 20:03
Base automatically changed from
docs/protocol-state-machines-design
to
develop
September 21, 2026 01:30
InvokeOperationWith takes OperationArguments, positional or named, binding a positional list to the operation's effective input parameters in signature order (semantics.Model.SignatureParametersOf) and selecting among same-named members through SelectAmongArguments. A mixed list is ErrMixedArguments and a surplus ErrOperationArity. %invoke accepts bare expressions beside its <p>=<expr> pairs. Co-Authored-By: jason.han <hanhuijun@gmail.com>
The field splitter drops string delimiters, so a positional or named string literal reached the argument parser unquoted. %invoke now cuts the object and operation off the raw line and parses the rest verbatim. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… develop Co-Authored-By: jason.han <hanhuijun@gmail.com>
An expression's overload selection sets actions aside whenever a calc of the name exists, since only a calc yields the value the expression needs. An operation invocation runs either, so it selects in a mode of its own, PerformsOperation, where the arguments alone decide between them. Co-Authored-By: jason.han <hanhuijun@gmail.com>
HuiJun
force-pushed
the
feature/positional-invoke-arguments
branch
from
September 21, 2026 01:30
4f8c00a to
9c10876
Compare
…ation Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
What and why
Context.InvokeOperationbound arguments by name only, and%invokerefused anything not written<p>=<expr>. An invocation in the model already binds positionally, so the two surfaces disagreed with each other and with the spec.semantics.Model.SignatureParametersOf(op)—signatureOf's effectivein/inoutparameters in signature order,outand result excluded — so a trailing defaulted parameter may be omitted, aninouttakes a position and comes back as a result, and anouttakes none. No second binder: this is the same signature anInvocationExpressionis bound to.operationOfnow collects every same-named member and, when there are several, selects throughsemantics.Model.SelectAmongArguments(the evaluator's overload selection), so two calcsscaled(factor)/scaled(factor, offset)are told apart by arity.ErrMixedArguments(KerML: anArgumentListis positional or named, never both),ErrOperationArityfor a surplus positional,ErrUnboundParameterunchanged for a missing required one.%invoke <object> <op> [<expr>... | <p>=<expr>...]via a newparseInvokeArguments; a mixed list and a parameter named twice are refused before the object is resolved (so a rejected command still materializes nothing). The sharedsplitArgs/continuesExprgained one rule — a<name>=…fragment always starts a new argument — so1 n=2no longer glues into one unparsable token;%calc/%analysiskeep their existing named-argument refusal.Shared plumbing touched:
repl/meta.gocontinuesExpr(one added clause) andsemantics/binding.go(new exportedSignatureParametersOfadapter oversignatureOf).Specification basis
KerML 1.0 §8.2.5.8.3 (
ArgumentListis aPositionalArgumentListor aNamedArgumentList) and §8.4.4.9.5 (a positional list binds the behavior's parameters in declaration order). Extends the Classifier Behaviors invocation row indocs/project/spec-compliance.md; the "Operation invocation with positional arguments" bullet leaves "Major Features Not Implemented"; roadmap E6 recorded as landed.How it was verified
runtime/classifier_behavior_test.go:TestInvokeOperationWithPositionalArguments— defaulted trailing parameter,inout,out, arity-resolved overloads, fewer/surplus/mixed lists, namedout.runtime/robustness_positional_invoke_test.go(TestRuntimeRobustnessPositionalInvoke).repl/classifier_behavior_test.go:TestInvokeBindsPositionalArguments,:TestInvokeReportsItsFailureModes(mixed, surplus, twice-named);object_args_test.gomalformed-command cases extended.go build ./...,go vet ./...,gofmt -l .empty,go test ./...green; training and pilot corpus gates green with corpora downloaded;scripts/changelog.py checkandscripts/check-doc-ids.pyclean.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog