From 9be1e56d207c2cf06c58424841ee7cef1496f254 Mon Sep 17 00:00:00 2001 From: Eksperimental Date: Thu, 28 Aug 2025 07:38:40 -0500 Subject: [PATCH 1/2] Correct docs for `Kernel.match?/2` `Kernel.match?/2` is not an operator, therefore there is not such a thing as `left` and `right` sides. --- lib/elixir/lib/kernel.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/elixir/lib/kernel.ex b/lib/elixir/lib/kernel.ex index 7c8e8545494..8bdbd8695ec 100644 --- a/lib/elixir/lib/kernel.ex +++ b/lib/elixir/lib/kernel.ex @@ -3524,8 +3524,7 @@ defmodule Kernel do end @doc """ - A convenience macro that checks if the right side (an expression) matches the - left side (a pattern). + A convenience macro that checks if `expression` matches `pattern`. ## Examples @@ -3603,7 +3602,7 @@ defmodule Kernel do #=> (MatchError) no match of right hand side value: %{x: 1, y: 2} """ - defmacro match?(pattern, expr) do + defmacro match?(pattern, expression) do success = quote do unquote(pattern) -> true @@ -3614,7 +3613,7 @@ defmodule Kernel do _ -> false end - {:case, [], [expr, [do: success ++ failure]]} + {:case, [], [expression, [do: success ++ failure]]} end @doc """ From faf04da4daddfea19d58a2880fd808445618137f Mon Sep 17 00:00:00 2001 From: Eksperimental Date: Thu, 28 Aug 2025 07:45:33 -0500 Subject: [PATCH 2/2] Update lib/elixir/lib/kernel.ex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Valim --- lib/elixir/lib/kernel.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/lib/kernel.ex b/lib/elixir/lib/kernel.ex index 8bdbd8695ec..ed9c05f7046 100644 --- a/lib/elixir/lib/kernel.ex +++ b/lib/elixir/lib/kernel.ex @@ -3524,7 +3524,7 @@ defmodule Kernel do end @doc """ - A convenience macro that checks if `expression` matches `pattern`. + A convenience macro that checks if the result of `expression` matches `pattern`. ## Examples