Skip to content

add method-style call syntax - #7281

Merged
mccanne merged 1 commit into
mainfrom
method-call
Sep 3, 2026
Merged

add method-style call syntax#7281
mccanne merged 1 commit into
mainfrom
method-call

Conversation

@mccanne

@mccanne mccanne commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

This commit adds a new calling syntax where a.foo(b,...) is equivalent foo(a,b,...). Docs will be updated in a future PR.

This commit adds a new calling syntax where a.foo(b,...) is equivalent
foo(a,b,...).  Docs will be updated in a future PR.

@nwt nwt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits: This is something we can debate later, but I think this operator should be |> or -> instead of . for a few reasons:

  1. To clarify to the reader that they're looking at a function application rather than a field reference (even more than the parentheses do)
  2. In a similar vein, to avoid the implication that the function is in some way a method bound to the operator's LHS rather than a plain old function
  3. To make room for |>> or ->> as a forward-last/thread-last/pipe-last operator where a |>> f(b) is equivalent to f(b, a)

@mccanne
mccanne merged commit 217a042 into main Sep 3, 2026
2 checks passed
@mccanne
mccanne deleted the method-call branch September 3, 2026 15:42
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