[erlang-questions] orddict - is it an expected behavior?

Minin Maxim Maxim.Minin@REDACTED
Tue Jan 12 13:50:50 CET 2016


Hi All,

is it an expected behavior?

1> orddict:merge(fun(_, _X, Y) -> Y end,  orddict:from_list([{1,a},{2,b}]), [{1,c},{1,f}]).
[{1,c},{1,f},{2,b}]

Here returns merge function an invalid orddict. 

I know, if the second argument is a valid orddict, all is fine:

2> orddict:merge(fun(_, _X, Y) -> Y end,  orddict:from_list([{1,a},{2,b}]), orddict:from_list([{1,c},{1,f}])).
[{1,f},{2,b}]

I would expect, that merge function either generates an exception or returns a proper orddict, but here is that not the case. Am I wrong?

Thanks
Maxim



More information about the erlang-questions mailing list