Skip to content

Commit a8385ef

Browse files
committed
Amend RFC1228 with operator fixity
1 parent bf6aab2 commit a8385ef

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

text/1228-placement-left-arrow.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,22 @@ lowest precedence) to highest in the language. The most prominent choices are:
168168
1. Less than assignment, as proposed by this RFC:
169169

170170
Assuming `()` never becomes a `Placer`, this resolves a pretty common
171-
complaint that a statement such as `let x = y <- z` is not clear or readable
172-
by forcing the programmer to write `let x = (y <- z)` to typecheck.
171+
complaint that a statement such as `x = y <- z` is not clear or readable
172+
by forcing the programmer to write `x = (y <- z)` for code to typecheck.
173173

174-
2. More than assignment and binop-assignment, but less than any other operator:
174+
2. Same as assignment and binop-assignment:
175+
176+
`x = y <- z = a <- b = c = d <- e <- f` parses as
177+
`x = (y <- (z = (a <- (b = (c = (d <- (e <- f)))))))`. This is so far
178+
the easiest option to implement in the compiler.
179+
180+
3. More than assignment and binop-assignment, but less than any other operator:
175181

176182
This allows for various expressions involving assignment to be parsed
177-
reasonably. For example `let x = y <- z += a <- b <- c` would get parsed as
178-
`let x = ((y <- z) += (a <- (b <- c)))`.
183+
reasonably. For example `x = y <- z += a <- b <- c` would get parsed as
184+
`x = ((y <- z) += (a <- (b <- c)))`.
179185

180-
3. More than any operator:
186+
4. More than any operator:
181187

182188
This is not a terribly interesting one, but still an option. Works well if
183189
we want to force people enclose both sides of the operator into parentheses

0 commit comments

Comments
 (0)