@@ -168,16 +168,22 @@ lowest precedence) to highest in the language. The most prominent choices are:
168
168
1 . Less than assignment, as proposed by this RFC:
169
169
170
170
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.
173
173
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:
175
181
176
182
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))) ` .
179
185
180
- 3 . More than any operator:
186
+ 4 . More than any operator:
181
187
182
188
This is not a terribly interesting one, but still an option. Works well if
183
189
we want to force people enclose both sides of the operator into parentheses
0 commit comments