Skip to content

Simplify event argument API: use arg instead of t_arg - #325

Merged
oblomov-dev merged 2 commits into
mainfrom
claude/nice-planck-236e31
Sep 15, 2026
Merged

oblomov-dev merged 2 commits into
mainfrom
claude/nice-planck-236e31

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

Summary

Refactors the event argument API across all documentation to use the simpler arg parameter for single-value cases, replacing the more verbose t_arg = VALUE #( ( ... ) ) syntax. The t_arg parameter remains available for multi-value scenarios.

Key Changes

  • API simplification: Updated all examples to use arg = value instead of t_arg = VALUE #( ( value ) ) for single arguments
  • Documentation clarity: Added explicit explanation that arg is the single-value spelling of t_arg, and that they are equivalent on the wire
  • Consistent formatting: Aligned parameter spacing in _event() calls across all code examples (removed extra spaces around =)
  • Updated comments: Changed references from t_arg to arg in inline documentation and method comments

Files Updated

  • docs/cookbook/event_navigation/backend.md — Added detailed explanation of arg vs t_arg relationship; updated all three event examples (Source, Parameters, Event)
  • docs/tutorials/walkthrough/step-6.md, step-7.md, step-9.md, step-10.md, step-12.md — Simplified event argument syntax
  • docs/cookbook/expert_more/value_help.md — Simplified value help picker event
  • docs/index.md — Updated homepage example

Implementation Details

  • The change is purely API surface and documentation; no backend behavior changes
  • arg and t_arg remain equivalent: arg = x is exactly t_arg = VALUE #( ( x ) )
  • For two or more values, users continue to use t_arg with table syntax and retrieve with client->get_event_arg( 2 ), ( 3 ), etc.

https://claude.ai/code/session_01JLUuftzubB7iRprxsDtVxD

`_event( arg = x )` is the one-value spelling of `t_arg = VALUE #( ( x ) )` —
the client folds it into the same string_table, so the wire and
`get_event_arg( )` are byte for byte what they were. The app that every
reader meets first (the front page, and the twelve walkthrough steps that
build it) was still spelling a single row out as a table constructor longer
than the value inside it, which is the notation it then teaches by example.

The wire now fits on one line, so the `val   =` padding that only existed to
align with the `t_arg =` continuation goes with it. Step 6, where the
argument is introduced, names `arg` and says what it is short for and where
`t_arg` takes over (from two values on).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLUuftzubB7iRprxsDtVxD
The Backend page is where an event argument is introduced, so it taught the
notation the rest of the site then copied: `t_arg = VALUE #( ( x ) )` for a
single value, where `arg = x` is the same wire - the client folds it into the
same string_table and `get_event_arg( )` reads it back unchanged. All four
examples on the page (source, parameters, event object, model property) carry
exactly one argument, and now say so; the comment lines between `val` and the
argument keep their place, so the multi-line shape stays where it earns it.

What the page loses by that - the table form itself - it gets back as a
sentence: from two values on, `t_arg` is the parameter, in that order, read
with `get_event_arg( 2 )` and up.

Value help was the one remaining wire of that shape on the site, and fits on
one line now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLUuftzubB7iRprxsDtVxD
@oblomov-dev
oblomov-dev merged commit fb56a82 into main Sep 15, 2026
1 check failed
@oblomov-dev
oblomov-dev deleted the claude/nice-planck-236e31 branch September 15, 2026 10:35
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.

2 participants