[erlang-questions] Wrong advertised spec of lists:append/2

Masklinn masklinn@REDACTED
Thu Mar 28 15:33:07 CET 2013


On 2013-03-28, at 15:12 , Pierre Fenoll wrote:

>> It's not a contradiction, as kostis noted specs are not complete
>> enumerations of all possible argument types.
> 
> Well, lists:append/2 asks for a list() as a second argument.

No, lists:append defines what happens with a list() as a second
argument, specs often aren't prescriptive.

> Shouldn't
> it badarg when I give it 'a', as in lists:append([], a) ?

Should it? Creating improper lists is not forbidden.



More information about the erlang-questions mailing list