[erlang-bugs] Document of lists:append/2
Mon Feb 10 04:52:14 CET 2014
This is just a surprising side effect of dynamic typing. To perform the
append, the left list is traversed and the right is just blindly used as
a tail, so it is never introspected and thus never has an opportunity to
On 2/9/14, 10:30 PM, Yoshihiro Tanaka wrote:
> In the document :http://www.erlang.org/doc/man/lists.html#append-2
> It says:
> append(List1, List2) -> List3, List1 = List2 = List3 = [T], T = term.
> But considering the following behavior, it does not look correct:
> 1>  ++ undef.
> 2> undef ++ .
> ** exception error: bad argument
> in operator ++/2
> called as undef ++ 
> 3> [a,b] ++ undef.
> Thoughts ?
> Thank you
More information about the erlang-bugs