summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2024-05-13 19:03:23 +0200
committerGitHub <noreply@github.com>2024-05-13 11:03:23 -0600
commite8d07adad1ce214f89ddfaf623115050ecd45c2b (patch)
tree3407d607a1f9892011ab1b4e10028d2b6e1bb6f6
parent5aa44434a22771a03e7143470f51979ca7c54e32 (diff)
[elixir/en] Give more context around comparison operators (#4792)
-rw-r--r--elixir.html.markdown10
1 files changed, 6 insertions, 4 deletions
diff --git a/elixir.html.markdown b/elixir.html.markdown
index 2748a983..c4da22e8 100644
--- a/elixir.html.markdown
+++ b/elixir.html.markdown
@@ -146,13 +146,15 @@ nil && 20 #=> nil
1 == 1.0 #=> true
1 === 1.0 #=> false
-# We can also compare two different data types:
+# Elixir operators are strict in theiar arguments, with the exception
+# of comparison operators that work across different data types:
1 < :hello #=> true
-# The overall sorting order is defined below:
-# number < atom < reference < functions < port < pid < tuple < list < bit string
+# This enables building collections of mixed types:
+["string", 123, :atom]
-# To quote Joe Armstrong on this: "The actual order is not important,
+# While there is an overall order of all data types,
+# to quote Joe Armstrong on this: "The actual order is not important,
# but that a total ordering is well defined is important."
## ---------------------------