<div dir="ltr"><div>The implementation in 18.1 (<a href="https://github.com/erlang/otp/blob/1523be48ab4071b158412f4b06fe9c8d6ba3e73c/erts/emulator/beam/erl_map.c#L2299-L2331">https://github.com/erlang/otp/blob/1523be48ab4071b158412f4b06fe9c8d6ba3e73c/erts/emulator/beam/erl_map.c#L2299-L2331</a>) certainly looks like they use the same ordering.<br><br></div>However, it would _never_ be a good idea to depend on that behavior. If you need to loop over key/value pairs, use maps:map/2 or maps:fold/3 or maps:to_list/1.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 11, 2015 at 1:35 PM, Kevin Montuori <span dir="ltr"><<a href="mailto:montuori@gmail.com" target="_blank">montuori@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi All --<br>
<br>
The maps documenation indicates that keys/1 and values/1 will return<br>
results in arbitrary order, which makes sense. I'm wondering if they'll<br>
return in the *same* arbitrary order. In other words, is this assertion<br>
always correct?<br>
<br>
M = maps:from_list(lists:zip(maps:keys(M), maps:values(M))).<br>
<br>
Thanks for any insight.<br>
<span class="HOEnZb"><font color="#888888"><br>
k.<br>
<br>
--<br>
Kevin Montuori<br>
<a href="mailto:montuori@gmail.com">montuori@gmail.com</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></span></blockquote></div><br></div>