list_to_binary vs iolist_to_binary

View: New views
2 Messages — Rating Filter:   Alert me  

list_to_binary vs iolist_to_binary

by db-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a sql query as a list and need to convert it to binary.  Both
function seems to take iolist as an argument and returns a binary()
type.  Only difference I see is that iolist_to_binary also takes in
binary as an argument.  Is that the only different?

--
rk

That which we persist in doing becomes easier for us to do; not that
the nature of the thing itself is changed, but that our power to do is
increased.
-Ralph Waldo Emerson
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions

Re: list_to_binary vs iolist_to_binary

by Adam Lindberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, an IO list can basically be any mix of lists (deep) and
binaries, and thus only one binary in one of its simpler forms. I
suppose it is for convenience purposes so that you don't have to know
whether your IO list is only a binary or a deeper list.

Cheers!
Adam
--
Adam Lindberg
http://www.erlang-consulting.com

On Tue, Jul 8, 2008 at 00:08, db <masterofquestions@...> wrote:

> I have a sql query as a list and need to convert it to binary.  Both
> function seems to take iolist as an argument and returns a binary()
> type.  Only difference I see is that iolist_to_binary also takes in
> binary as an argument.  Is that the only different?
>
> --
> rk
>
> That which we persist in doing becomes easier for us to do; not that
> the nature of the thing itself is changed, but that our power to do is
> increased.
> -Ralph Waldo Emerson
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@...
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions
LightInTheBox - Buy quality products at wholesale price