[erlang-bugs] error in R12B Efficiency Guide

Ulf Wiger (TN/EAB) <>
Thu Jan 24 17:59:31 CET 2008


Has this been reported already?

http://www.erlang.org/doc/efficiency_guide/part_frame.html

Under Common Caveats, 3.4 length/1:

"foo(L) when length(L) >= 3 ->
     ...

can be rewritten to

foo([_,_,_]=L) ->
    ..."

The two declarations are of course not equivalent.
The alternative should rather be:

foo([_,_,_|_] = L) ->
    ...

BR,
Ulf W



More information about the erlang-bugs mailing list