Skip to content

Commit e2c4c07

Browse files
authored
Document ternary operators, closes #14959 (#14964)
1 parent 2acf580 commit e2c4c07

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/elixir/pages/references/operators.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Operator | Associativity
2121
`*` `/` | Left
2222
`+` `-` | Left
2323
`++` `--` `+++` `---` `..` `<>` | Right
24+
`//` (valid only inside `..//`) | Right
2425
`in` `not in` | Left
2526
`\|>` `<<<` `>>>` `<<~` `~>>` `<~` `~>` `<~>` | Left
2627
`<` `>` `<=` `>=` | Left
@@ -29,11 +30,18 @@ Operator | Associativity
2930
`\|\|` `\|\|\|` `or` | Left
3031
`=` | Right
3132
`&`, `...` | Unary
32-
`=>` (valid only inside `%{}`) | Right
3333
`\|` | Right
3434
`::` | Right
3535
`when` | Right
3636
`<-` `\\` | Left
37+
`=>` (valid only inside `%{}`) | None
38+
39+
Elixir also has two ternary operators:
40+
41+
Operator | Associativity
42+
---------------------------------------------- | -------------
43+
`first..last//step` | Right
44+
`%{map \| key => value, ...}` | None
3745

3846
## General operators
3947

0 commit comments

Comments
 (0)