[erlang-bugs] Any special reason why filename:join/1 doesn't accept empty lists?

Roberto Aloi roberto.aloi@REDACTED
Thu Mar 1 17:43:37 CET 2012


Hi all,

I've just noticed that filename:join/1 doesn't accept empty lists as input.
This seems not clear in the documentation:

http://www.erlang.org/doc/man/filename.html#join-1

join(Components) -> file:filename()
Components = [file:filename()]

>From the file documentation:

http://www.erlang.org/doc/man/file.html#type-filename

filename() = string() | binary()

As oppose example, take lists:concat/1:

http://www.erlang.org/doc/man/lists.html#concat-1

concat(Things) -> string()
Things = [Thing]
Thing = atom() | integer() | float() | string()

1> lists:concat([]).
[]
2> filename:join([]).   
** exception error: no function clause matching filename:join([]) (filename.erl, line 392)

Cheers,

Roberto Aloi
---
Erlang Solutions Ltd.
www.erlang-solutions.com




More information about the erlang-bugs mailing list