<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi<div class=""><br class=""></div><div class="">Even though documentation indicates that:</div><div class=""><br class=""></div><div class=""><div class="func-head bold_code"><font face="Courier" class="">to_list(Map) -> [{Key, Value}]</font></div><div class="REFBODY fun-types">
<h3 class="func-types-title"><font face="Courier" class="">Types</font></h3>
<div class="REFTYPES rt-1"><span class="bc-2 bold_code"><font face="Courier" class="">Map = map()</font></span></div>
<div class="REFTYPES rt-1"><span class="bc-2 bold_code"><font face="Courier" class="">Key = Value = term()</font></span></div>
<div class="REFTYPES rt-1"><font face="Courier" class=""><span class="bc-2 bold_code"></span></font></div>
</div><div class=""><font face="Courier" class=""><br class="webkit-block-placeholder"></font></div>
<div class="REFBODY rb-7"><div class="">
        <font face="Courier" class=""><br class="webkit-block-placeholder"></font></div><p class=""><font face="Courier" class="">Returns a list of pairs representing the key-value associations of
          <span class="code">Map</span>, where the pairs
          <span class="code">[{K1,V1}, ..., {Kn,Vn}]</span> <b class=""><i class="">are returned in arbitrary order.</i></b></font></p><div class="">It appears that the list returned has been sorted in ascending order, using value of the key as a criterion for sorting.</div><div class="">I did some testing using a bit modified example offered in documentation:</div><div class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(x@MacBook-Pro)47> f(Map), Map = #{42 => value_three,1337 => "value two","a" => 1, 1 => "Last entered"},maps:to_list(Map).  </span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">[{1,"Last entered"},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {42,value_three},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {1337,"value two"},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {"a",1}]</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">When I changed 1337 to -1337, I get the result that indicates that the list of pairs is *not* returned in arbitrary order, but actually sorted:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(x@MacBook-Pro)48> </span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(x@MacBook-Pro)48> f(Map), Map = #{42 => value_three, -1337 => "value two","a" => 1, 1 => "Last entered"},maps:to_list(Map).</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">[{-1337,"value two"},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {1,"Last entered"},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {42,value_three},</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {"a",1}]</span></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(255, 238, 149); background-color: rgb(78, 78, 78);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Could one relay on this always being the case?</span></div><div class="">A I need this list to be sorted, I would hate to attempt sorting the already sorted list.</div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Thanks in advance</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">V/</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></div></body></html>