<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Dan Gudmundsson" <dgud@erlang.org><br><br><div dir="ltr"><br><div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif">Robert Virding</div>
<div style="font-size:12.727272033691406px;font-family:arial,sans-serif">> Use only matching</div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif"><br></div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif">
We would like to but we believe we can not do that because we can't output a defined order, </div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif">i.e. you can not sort 1.0 and 1.</div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif">
We would need to define a new term order in erlang and we need to introduce something</div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif">like <:<, >:> =:< and >:=.</div><div id="DWT457" style="font-size:12.727272033691406px;font-family:arial,sans-serif">
<br></div></div></div></blockquote>I personally think this would be a good idea to introduce anyway as I think today's comparison ops are not good. So:<br><br>- introduce a new set of comparison operators that do not convert integers to floats on comparison<br>- fix the term ordering for this. This is actually very easy, just make integers < floats, we are comparing *terms*<br>- modify the libraries which use comparisons to use the new ops<br>- use them in maps if we are going to have sorted maps<br><br>I know we can't make the existing comparison ops only work numbers, but it would be nice.<br><br>Robert<br><br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div><div style="font-size:12.727272033691406px;font-family:arial,sans-serif"></div></div></div></blockquote></div></body></html>