[erlang-questions] definition of iolist

David Terrell dbt@REDACTED
Fri Aug 31 16:40:31 CEST 2007


On Fri, Aug 31, 2007 at 02:27:54PM +0200, Bjorn Gustavsson wrote:
> 
> Anthony Shipman <als@REDACTED> writes:
> 
> > The documentation often says this:
> > 
> > iolist = [char() | binary() | iolist()]
> >   a binary is allowed as the tail of the list
> > 
> > This says to me that an iolist is a list whose members can be characters, 
> > binaries or iolists. In which case it is automatic that a binary can be the 
> > tail of the list. So what is the point of the comment?
> 
> A character is not allowed in the tail.

I think I'm misunderstanding you... wouldn't this forbid a 
normal erlang string from being considered a valid iolist?

1> list_to_binary(["abcdefg", $h]).
<<"abcdefgh">>

-- 
David Terrell
dbt@REDACTED
((meatspace)) http://meat.net/



More information about the erlang-questions mailing list