[erlang-questions] Trouble with Erlang's lenient comparisons

H. Diedrich hd2010@REDACTED
Wed Apr 13 18:04:13 CEST 2011


Robert Virding schrieb:
> The comparison operators as they are now were a mistake, almost a bad 
> mistake. IMAO what we should have done was to have had two different 
> sets of operators, one set of numeric comparisons (without type 
> conversion) and one set of gerneral term comparisons (without type 
> conversion). So for example:
>
> == /= =< < >= >   would only work on numbers
> @== @/= @=< @< @>= @>   would work on all terms
>
> Note that the existing =:= =/= are the same as @== @/= in my scheme 
> above.
>
> We could add the full set of term comparison operators, but not change 
> the existing operators
So you could introduce the @ variants for numbers only instead. How 
about a triple sign notation for "strictness", as ===, /==, ==< ... !? 
Well ... <=< ... :-<


Henning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110413/64ed1e3f/attachment.htm>


More information about the erlang-questions mailing list