[erlang-bugs] error in R12B Efficiency Guide

Bjorn Gustavsson bjorn@REDACTED
Mon Jan 28 11:56:00 CET 2008


Thanks! I have now corrected this embarrassing mistake.

/Bjorn

"Ulf Wiger (TN/EAB)" <ulf.wiger@REDACTED> writes:

> 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
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs
> 

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list