[erlang-questions] Proposal for is_iolist/1 guard

Oscar Hellström oscar@REDACTED
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 <oscar@REDACTED
> <mailto:oscar@REDACTED>>
>
>     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
>     > erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     > http://www.erlang.org/mailman/listinfo/erlang-questions
>     Best regards
>
>     --
>     Oscar Hellström, oscar@REDACTED
>     <mailto:oscar@REDACTED>
>     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
>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     http://www.erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Oscar Hellström, oscar@REDACTED
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