[erlang-questions] constructing binaries question

Yariv Sadan yarivvv@REDACTED
Thu Sep 14 21:58:32 CEST 2006


Sorry, I also forgot to ask: is there a way of converting an atom to a
binary without first converting it to a list? I noticed you can call
term_to_binary and discard the first 4 bytes but that feels like
cheating :)

Yariv

On 9/14/06, Yariv Sadan <yarivvv@REDACTED> wrote:
> hi,
>
> I'm writing some code to construct a binary SQL statement from some
> parameters (table name, field names, field values, etc). I'm not sure
> if I should iteratively add more chunks to a binary representing the
> statement, or if I should build the statement from a list of strings
> and then call list_to_binary at the end. What's the rule of thumb for
> working with binaries as opposed to lists in such a scenario?
>
> Thanks in advance,
> Yariv
>



More information about the erlang-questions mailing list