[erlang-questions] {1} > 100 returns true ?!

Robert Virding rvirding@REDACTED
Fri May 15 23:58:44 CEST 2009


2009/5/15 Michael McDaniel <erlangy@REDACTED>

>
>  Per documentation in the reference manual section 6.11 Term Comparison,
>  numbers compare less than tuples ...
>
> "The arguments may be of different data types.
>  The following order is defined:
> number < atom < reference < fun < port < pid < tuple < list < bit string"
>
> If you are asking *why* that design decision was made, I do not know.
>

It was practical and useful to do so, and there was no real reason to
restrict it. What might have been better, 20/20 hindsight, would have been
to have 2 separate sets of comparison functions, those that work on anything
and those that only work on numbers.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090515/46d6ef8a/attachment.htm>


More information about the erlang-questions mailing list