-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiline method chain syntax #393
Comments
How about making this work with
I guess it sacrifices readability a lot more... |
The pipeline operator already exists in Erg. True |> assert()
assert -1 + -1 |> .abs() == 2 It might be a good to add the rule regarding this operator. |
Oh cool! Ignore me then :P |
@zetashift This isn't entirely related to Erg, but for what it's worth since this issue was linked to an F# issue, F# actually allows method chaining. type Test() =
member this.A () = this
member this.B () = this
member _.C () = ()
let test = Test()
test.A()
.B()
.C()
// or
test.A().B().C() The linked feature of allowing While strange indentation like test
.A()
.B()
.C() is allowed in F#, it isn't recommended. That might be relevant to the original proposal here for Erg. |
This syntax allows
to be rewritten as
Indentation is important,
is invalid (this means sequential execution of
x
and.foo()
).The text was updated successfully, but these errors were encountered: