Skip to content

Add '<-', a message send that yields the recipient - #60

Merged
gitosaurus merged 1 commit into
mainfrom
feat/send-to-operator
Aug 13, 2026
Merged

Add '<-', a message send that yields the recipient#60
gitosaurus merged 1 commit into
mainfrom
feat/send-to-operator

Conversation

@gitosaurus

Copy link
Copy Markdown
Owner

Where `->` evaluates to the last value of the method it ran, `<-` evaluates to the object that received the message. That makes sends chain — `system <- 'INIT SORTER' <- "dog" <- "cat"` — which suits system's protocols, where the sequence of messages is the point and the replies are not. It also lets a stateful recipient be primed inside a larger expression: `"file.acx" -> (system <- 'LOAD STATE')` is the one-line form of what previously took two statements, and unlike the pure chain it keeps the final send's reply.

An unparenthesized mix of `->` and `<-` would reassociate into something nobody intends; that is refused at parse time rather than quietly obeyed. `OP_SEND_TO` is appended to the operator enum rather than filed alphabetically, since those enumerators are the ints written into `.acx` files.

Rebased onto main; the only conflicts were both sides appending a test method to the same two lists in `TestSystemObject`, resolved by keeping both. All 18 test suites pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AUmuc82NHf76PrRYjgLhq5

Where "->" evaluates to the last value of the method it ran, "<-" evaluates
to the object that received the message.  That makes sends chain --
(system <- 'INIT SORTER' <- "dog" <- "cat") -- which suits system's
protocols, where the sequence of messages is the point and the replies are
not.  It also lets a stateful recipient be primed inside a larger
expression: ("grab" -> (system <- 'WHICH OBJECT')) is the one-line form of
what previously took two statements.

The operator groups to the left, which is what makes chaining work at all:
each send hands the recipient back for the next one to send to.  It shares
"->"'s precedence, so an unparenthesized mix of the two would reassociate
into something nobody intends; that is refused at parse time rather than
quietly obeyed.

OP_SEND_TO is appended to the operator enum rather than filed alphabetically
next to "<".  Those enumerators are the ints written into .acx files, so
inserting one in the middle would invalidate every compiled game and save
file in existence.

Experimental, and parked on a branch until it earns its place: this adds a
second way to say something the language could already say.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LscjcoeFJ4R4w2AAs193Yo
@gitosaurus
gitosaurus merged commit 45fc19b into main Aug 13, 2026
2 checks passed
@gitosaurus
gitosaurus deleted the feat/send-to-operator branch August 13, 2026 16:37
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