Skip to content

Commit b888674

Browse files
authored
Clarify what specifying the module name does with & (#13668)
1 parent 8539b5b commit b888674

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/elixir/lib/kernel/special_forms.ex

+9
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,15 @@ defmodule Kernel.SpecialForms do
17861786
17871787
&local_function/1
17881788
1789+
Note that `&local_function/1` creates a local capture, but
1790+
`&__MODULE__.local_function/1` or `&imported_function/1` create a remote
1791+
capture. For more information, refer to the ["Functions" section in the Erlang Reference Manual](https://www.erlang.org/doc/system/eff_guide_functions.html#function-calls).
1792+
1793+
Whether a capture is local or remote has implications when using hot code
1794+
reloading: local captures dispatch to the version of the module that existed
1795+
at the time they were created, while remote captures dispatch to the current
1796+
version of the module.
1797+
17891798
See also `Function.capture/3`.
17901799
17911800
## Anonymous functions

0 commit comments

Comments
 (0)