Search in record list

Bengt Kleberg bengt.kleberg@REDACTED
Mon Mar 20 06:22:04 CET 2006


On 2006-03-18 16:41, Kostis Sagonas wrote:
...deleted
> IMO, the compiler, to the extent it can, should warn about redundant
> clauses.  Currently, there is a check for redundant clauses, but it
> is very rudimentary. It can be improved. For example, the compiler
> could warn for the above and also for `similar' functions as e.g.
> 
> b(N) when is_number(N) -> number;
> b(I) when is_integer(I) -> integer.

is it documented that function cluses are tried in the order they are 
written?
otherwise i think that it would be nice if the compiler could 
''rearrange'' these 2 cluses for me, so that
b(1) => integer


bengt



More information about the erlang-questions mailing list