From e8d07adad1ce214f89ddfaf623115050ecd45c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 13 May 2024 19:03:23 +0200 Subject: [PATCH] [elixir/en] Give more context around comparison operators (#4792) --- elixir.html.markdown | 10 ++++++---- 1 file 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." ## ---------------------------