Commit 3e4216f
authored
Clarify how agent passes state to anonymous func (elixir-lang#1380)
When encountering Agents for the first time, it is not clear that they pass their state to anonymous functions in this way. This problem stumped me for a whole day yesterday, when I couldn't figure out what was going on with that `&1`. It finally made sense when someone on the ElixirForum gave me this crucial piece of information, that the Agent calls the anonymous function and passes its state to it via the placeholder argument `&1`.1 parent 3afcdb1 commit 3e4216f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
0 commit comments