Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b17a0c7 commit ea8f8e5Copy full SHA for ea8f8e5
getting-started/basic-types.markdown
@@ -216,7 +216,9 @@ Note a dot (`.`) between the variable and parenthesis is required to invoke an a
216
Anonymous functions are closures, and as such they can access variables that are in scope when the function is defined:
217
218
```iex
219
-iex> add_two = fn a -> add.(a, 2) end
+iex> b = 2
220
+2
221
+iex> add_two = fn a -> add.(a, b) end
222
#Function<6.71889879/1 in :erl_eval.expr/5>
223
iex> add_two.(2)
224
4
0 commit comments