From 40163ab10078a73c22656e013c5e27f531c05f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 26 Nov 2025 20:55:34 +0100 Subject: [PATCH 1/3] Document ternary operators, closes #14959 --- lib/elixir/pages/references/operators.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/elixir/pages/references/operators.md b/lib/elixir/pages/references/operators.md index de541e3150..38336702b9 100644 --- a/lib/elixir/pages/references/operators.md +++ b/lib/elixir/pages/references/operators.md @@ -21,6 +21,7 @@ Operator | Associativity `*` `/` | Left `+` `-` | Left `++` `--` `+++` `---` `..` `<>` | Right +`//` (valid only inside `..//`) | Right `in` `not in` | Left `\|>` `<<<` `>>>` `<<~` `~>>` `<~` `~>` `<~>` | Left `<` `>` `<=` `>=` | Left @@ -29,11 +30,18 @@ Operator | Associativity `\|\|` `\|\|\|` `or` | Left `=` | Right `&`, `...` | Unary -`=>` (valid only inside `%{}`) | Right `\|` | Right `::` | Right `when` | Right `<-` `\\` | Left +`=>` (valid only inside `%{}`) | None + +Elixir also has two ternary operators: + +Operator +------------------------------ +`first..last//step` +`%{map | key => value, ...}` ## General operators From f37d8d821daafb605ec0770eba9acb0579c91445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 27 Nov 2025 10:58:02 +0100 Subject: [PATCH 2/3] Fix formatting of operators in documentation --- lib/elixir/pages/references/operators.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/elixir/pages/references/operators.md b/lib/elixir/pages/references/operators.md index 38336702b9..a4140c56ab 100644 --- a/lib/elixir/pages/references/operators.md +++ b/lib/elixir/pages/references/operators.md @@ -38,10 +38,10 @@ Operator | Associativity Elixir also has two ternary operators: -Operator ------------------------------- -`first..last//step` -`%{map | key => value, ...}` +Operator | Associativity +---------------------------------------------- | ------------- +`first..last//step` | Right +`%{map | key => value, ...}` | None ## General operators From 8a7ac07d6f333e1a82a6563a2c69be1e9aa974d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 27 Nov 2025 11:02:54 +0100 Subject: [PATCH 3/3] Update lib/elixir/pages/references/operators.md --- lib/elixir/pages/references/operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/pages/references/operators.md b/lib/elixir/pages/references/operators.md index a4140c56ab..51e5e59070 100644 --- a/lib/elixir/pages/references/operators.md +++ b/lib/elixir/pages/references/operators.md @@ -41,7 +41,7 @@ Elixir also has two ternary operators: Operator | Associativity ---------------------------------------------- | ------------- `first..last//step` | Right -`%{map | key => value, ...}` | None +`%{map \| key => value, ...}` | None ## General operators