Skip to content

Commit

Permalink
Amend RFC1228 with operator fixity
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Oct 14, 2015
1 parent bf6aab2 commit a8385ef
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions text/1228-placement-left-arrow.md
Expand Up @@ -168,16 +168,22 @@ lowest precedence) to highest in the language. The most prominent choices are:
1. Less than assignment, as proposed by this RFC:

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

2. More than assignment and binop-assignment, but less than any other operator:
2. Same as assignment and binop-assignment:

`x = y <- z = a <- b = c = d <- e <- f` parses as
`x = (y <- (z = (a <- (b = (c = (d <- (e <- f)))))))`. This is so far
the easiest option to implement in the compiler.

3. More than assignment and binop-assignment, but less than any other operator:

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

3. More than any operator:
4. More than any operator:

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

0 comments on commit a8385ef

Please sign in to comment.