構造体の別のリストにネストされたキーを持つ構造体があり、そのネストしたキー値を新しい値で更新したいとします。ハッシュの値を更新できません
source = get_data
# source.key1 is an array of structs
source.key1 = Enum.each(source.key1, fn(x) -> # error is here at "="
# ...
end)
エラーは次のとおりです。
cannot invoke remote function source.key1/0 inside match
どちらもこの:
aa = Enum.each(source.key1, fn(x) ->
# ...
end)
source.key1 = aa # error is here