Append To A Keyword List
> a = [a: 1]
[a: 1]
> b = [b: 2]
[b: 2]
> a ++ b
[a: 1, b: 2]> x = :x
:x
> c = a ++ [x 5]
** (CompileError) iex:5: undefined function x/1
(stdlib) lists.erl:1353: :lists.mapfoldl/3
(stdlib) lists.erl:1354: :lists.mapfoldl/3> c = a ++ [x, 5]
[{:a, 1}, :x, 5]> c = a ++ [{x, 5}]
[a: 1, x: 5]Last updated