summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKian Meng Ang <kianmeng.ang@gmail.com>2021-12-04 03:23:22 +0800
committerGitHub <noreply@github.com>2021-12-03 20:23:22 +0100
commit4995e0671309b2b70351cbb7f43408f12d913303 (patch)
treee082e8bcbc4e1582d43449e141e360fa9fca4082
parent1b1b2c84bedfcd944b7d8b910fb56f72b5557620 (diff)
downloadelixir-4995e0671309b2b70351cbb7f43408f12d913303.tar.gz
Update code example for unquote/1 (#11437)
The output have changed since 1.13.0-rc.0.
-rw-r--r--lib/elixir/lib/kernel/special_forms.ex8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/elixir/lib/kernel/special_forms.ex b/lib/elixir/lib/kernel/special_forms.ex
index 7aa97f86f..0e7639cb0 100644
--- a/lib/elixir/lib/kernel/special_forms.ex
+++ b/lib/elixir/lib/kernel/special_forms.ex
@@ -1315,11 +1315,13 @@ defmodule Kernel.SpecialForms do
sum(1, value, 3)
end
- Which would then return:
- {:sum, [], [1, {:value, [], Elixir}, 3]}
+ Which the argument for the `:sum` function call is not the
+ expected result:
- Which is not the expected result. For this, we use `unquote`:
+ {:sum, [], [1, {:value, [if_undefined: :apply], Elixir}, 3]}
+
+ For this, we use `unquote`:
iex> value =
...> quote do