Compares the values.
Note that you can chain multiple less-than and less-than-or-equals in the same expression.
The rules for different types are as follows:
- Numbers are compared in the usual way. All the numbers must have the same units.
- For booleans, false is less than true.
- Text is compared lexicographically using the Unicode codepoints. English capitals
come before lower-case so while bear comes before cat, Zebra comes before ant.
- Date, YearMonth, Time and DateTime are compared in the usual way (earlier dates or
times are less than later dates or times).
- DateTimeZoned is compared by converting to the UTC DateTime and then comparing that.
- Tuples are compared by initially comparing the first item. If the first items differ,
that is the result of the comparison. Only if the first items are equal will the
second values be compared, and so on until they are all equal, or there is a result.
- Lists are compared lexicographically. The empty list is less than all other lists.
If both lists are non-empty, the first item is compared. If these differ, that is
the result. Only if the first items are the same are the second values compared.
If lists are equal until one of them ends, the shorter list is less than the longer
list.
- Tagged items are compared using their tag order. Earlier tags are less than later
tags. Items with the same tag are compared using their inner value, if present.
1 < abs(-2) < 3→true
false < true→true
"mud" < "muddle"→true
as type(type{DateTimeZoned}, from text("2013-05-02 12:00 Europe/London")) < from text("2013-05-02 11:37 America/Toronto")→true
Optional\None < Optional\Is(0)→true
(a:0, b:5) < (a:1, b:3)→true