aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-09-09 11:27:46 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-09-09 11:27:46 +0200
commit439de942a4db2a422dbfe7813f66b150f947313f (patch)
tree7ec8183840edef31f76ebe645ed61c42ebb6e6ce
parent65486a69b20878cd5852f2cd98161e071b7e8160 (diff)
parent767a7cfa99dc454da9d2712b3a5f2dd1c1c89165 (diff)
downloadotp-439de942a4db2a422dbfe7813f66b150f947313f.tar.gz
otp-439de942a4db2a422dbfe7813f66b150f947313f.tar.bz2
otp-439de942a4db2a422dbfe7813f66b150f947313f.zip
Merge branch 'egil/fix-maps-doc/OTP-12970' into maint
* egil/fix-maps-doc/OTP-12970: doc: Update term comparison with Maps
-rw-r--r--system/doc/reference_manual/expressions.xml12
1 files changed, 10 insertions, 2 deletions
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 668a51d6bc..893398b71b 100644
--- a/system/doc/reference_manual/expressions.xml
+++ b/system/doc/reference_manual/expressions.xml
@@ -568,10 +568,14 @@ Expr1 <input>op</input> Expr2</pre>
<p>The arguments can be of different data types. The following
order is defined:</p>
<pre>
-number &lt; atom &lt; reference &lt; fun &lt; port &lt; pid &lt; tuple &lt; list &lt; bit string</pre>
+number &lt; atom &lt; reference &lt; fun &lt; port &lt; pid &lt; tuple &lt; map &lt; nil &lt; list &lt; bit string</pre>
<p>Lists are compared element by element. Tuples are ordered by
size, two tuples with the same size are compared element by
element.</p>
+ <p>Maps are ordered by size, two maps with the same size are compared by keys in
+ ascending term order and then by values in key order.
+ In maps key order integers types are considered less than floats types.
+ </p>
<p>When comparing an integer to a float, the term with the lesser
precision is converted into the type of the other term, unless the
operator is one of <c>=:=</c> or <c>=/=</c>. A float is more precise than
@@ -591,7 +595,11 @@ true
2> <input>1=:=1.0.</input>
false
3> <input>1 > a.</input>
-false</pre>
+false
+4> <input>#{c => 3} > #{a => 1, b => 2}.</input>
+false
+4> <input>#{a => 1, b => 2} == #{a => 1.0, b => 2.0}.</input>
+true</pre>
</section>
<section>