Infix methods #8192
Unanswered
Adiras
asked this question in
Language Ideas
Infix methods
#8192
Replies: 3 comments
-
This feels very awkward to parse and I don't really see the benefit to be honest, but I've never seen the suggestion before - cool |
Beta Was this translation helpful? Give feedback.
0 replies
-
F# has support for pipes, which is similar to what you want. https://theburningmonk.com/2011/09/fsharp-pipe-forward-and-pipe-backward/ |
Beta Was this translation helpful? Give feedback.
0 replies
-
It should be worth noting that Scala has this, and I'm not sure it's well-liked: https://docs.scala-lang.org/style/method-invocation.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider adding infix notation for method calls in the language syntax, without requiring the use of periods (.) and parentheses (). This enhancement would allow for more natural language-like code and facilitate the creation of domain-specific languages (DSLs) on top of C#.
A similar functionality already exists in Kotin language: https://kotlinlang.org/docs/functions.html#infix-notation.
Example
The following examples demonstrates the use of the described functionality.
Old way:
Using infix methods:
Language-Level Support
Backward Compatibility
Beta Was this translation helpful? Give feedback.
All reactions