-
Notifications
You must be signed in to change notification settings - Fork 111
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
Simpler Syntax #288
Comments
Why is that simpler? That also seems more akin to F# syntax, which was rejected in favor of Hack (specifically, assuming that a value is a function) |
It is simpler because it avoids nesting and needs less meta characters. As the proposal notes, nesting makes reading harder. |
in my opinion |> is better than ~> because |
Besides the fact that the location of the a = b|>c(%,7)|>d(%, 8) Or this a = b|>c(%,7)|>d(8, %) to your version. |
Yup, the core idea here is just F#-style again. See #221 for why that was rejected by the committee and is not being pursued.
The only nesting in your examples is in the original non-pipelined code, where calls are nested inside each other. The pipeline'd version just has functions being called - that's not nesting. |
That is the point of pipes, isn't it?
It would become: a = b,7 ~> c,8 ~> d
That is: a = b,7 ~> 8,c ~> d |
No, the point is to linearize nested code. |
That is what I mean. Nested:
Linearized:
|
That’s not nested, though - it’s linear. |
How so? Because % and 7 are not function calls? We can "fix" that by replacing 7 with e(). Current proposal:
My proposal:
The issue with the current proposal is that it tries to avoid nesting, support multiple input parameters and use pipes that only carry a single value. And therefore must fail in at least one aspect. It fails in regards to nesting. |
Because any sensible codebase would pad |
So in the current proposal, this:
Becomes this:
I would very much prefer a simpler syntax. Example:
Any insurmountable hindrances towards a simple syntax like b,7~>c~>d?
The text was updated successfully, but these errors were encountered: