[erlang-questions] List pipe syntax

Richard Carlsson richardc@REDACTED
Mon Dec 18 13:29:04 CET 2006

Alexander Harju wrote:
> It's definitely not a list, but what is it then and why does
> erlang:is_list return true?

erlang:is_list/1 only checks the outermost constructor, and returns
true if it is [] or [_|_], otherwise it returns false. There is no
built-in function that tests that the list is proper. (However, a
function like length/1 will throw an exception if the list is not
properly nil-terminated, and could be used for such tests.)


More information about the erlang-questions mailing list