[erlang-questions] bit syntax or tokens ?

Jesper Louis Andersen <>
Sat Jul 3 16:55:18 CEST 2010


On Sat, Jul 3, 2010 at 11:56 AM, info <> wrote:
> Thank you Robert,
> Once I have got them, I will mainly compare with string data or make calculation.
> if A == "ABC" -> ...
> Sometimes I want A as a string, sometimes A as integer !!

One way to achieve this is the decode the binary as both a string and
an integer, and then lug both around at the same time.

> I try to stay with the bit syntax "as long as possible" but I don't know if it's a good approach !

My guess is you wont win much by doing this. Of course, the string is
taking up some space, but lugging it around is still just a
pointer-pass. I wouldn't worry too much about it until it ends up
being a bottleneck.

-- 
J.


More information about the erlang-questions mailing list