Created
May 21, 2014 02:46
-
-
Save knewter/b1b5de17a7fb93d84509 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex(1)> increment = &Map.update!(&1, :count, fn(x) -> x + 1 end) | |
#Function<6.106461118/1 in :erl_eval.expr/5> | |
iex(2)> increment = fn(x) -> x[:count] = x[:count] + 1 end | |
** (ArgumentError) dynamic access cannot be invoked inside match and guard clauses | |
(elixir) expanding macro: Kernel.access/2 | |
(elixir) iex:2: :elixir_compiler.__FILE__/2 | |
iex(2)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment