[erlang-questions] Wrong advertised spec of lists:append/2
Thu Mar 28 14:50:19 CET 2013
Indeed, what does the 2'nd line mean?
1: 16> [a, b] ++ c.
3: 17> c ++ [a, b].
4: ** exception error: bad argument
5: in operator ++/2
6: called as c ++ [a,b]
On Thu, Mar 28, 2013 at 3:42 PM, Adam Rutkowski <> wrote:
> On 28 Mar 2013, at 14:36, Pierre Fenoll wrote:
>> As per the doc, the spec of lists:append/2 is ([term()], [term()]) -> [term()].
>> However, a = lists:append(, a).
> If the spec was ([term()], term()) then maybe ;-)
> Also, the documentation (and implementation as well) clearly states it's equivalent to A ++ B.
> erlang-questions mailing list
More information about the erlang-questions