[erlang-questions] Proposal for is_iolist/1 guard

Oscar Hellström <>
Tue May 26 15:50:02 CEST 2009


So if it's a list, you'd like to traverse the list and check if each
value is either a binary, another iolist or an integer >= 0 and < 256?

Robert Virding wrote:
> Unfortunately not, as an iolist can also be a nested list strucure
> containing bytes/characters and binaries.
>
> Robert
>
> 2009/5/26 Oscar Hellström <
> <mailto:>>
>
>     Hi Maxim,
>
>     Wouldn't is_list(X); is_binary(X) be enough?
>
>     Maxim Treskin wrote:
>     > Hello
>     >
>     > I see, erlang does not have is_iolist/1 guard, while iolist() type
>     > used in some places in OTP (i.e. ports interaction).
>     > Is it possible to add this BIF?
>     >
>     > Thank you.
>     >
>     > --
>     > Maxim Treskin
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > erlang-questions mailing list
>     >  <mailto:>
>     > http://www.erlang.org/mailman/listinfo/erlang-questions
>     Best regards
>
>     --
>     Oscar Hellström, 
>     <mailto:>
>     Office: +44 20 7655 0337
>     Mobile: +44 798 45 44 773
>     Erlang Training and Consulting Ltd
>     http://www.erlang-consulting.com/
>
>     _______________________________________________
>     erlang-questions mailing list
>      <mailto:>
>     http://www.erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Oscar Hellström, 
Office: +44 20 7655 0337
Mobile: +44 798 45 44 773
Erlang Training and Consulting Ltd
http://www.erlang-consulting.com/




More information about the erlang-questions mailing list