I’m trying to update a deeply nested map (actually, a struct) and am not having any luck. Here’s the scenario:
key2 = :"some.key"
Kernel.update_in(state.key1."some.key".key3, &Map.delete(&1, "keyval")) # seems to work fine
Kernel.update_in(state.key1.key2.key3, &Map.delete(&1, "keyval")) # fails, since key2 is a data item, not an atom.
Kernel.update_in(state.key1[key2].key3, &Map.delete(&1, "keyval")) # fails atrociously - beam uses up all available ram, then crashes.
I’m sure that I’m doing this entirely wrong - I can’t believe that this would be a bug - same behavior on 1.4.5, 1.5.1 and 1.6.0-dev.
What am I doing wrong?






















