Traversing a binary

Thomas Lindgren <>
Wed Sep 22 10:51:18 CEST 2004

--- Erik Stenman <> wrote:

> You could also traverse the binary without creating
> new sub-binaries, by 
> keeping
> track of how many byte-pairs you have seen (N):

Nice trick. Perhaps something for a compiler to

I can think of two things here:

- Adding notation for indexing into binaries (like
indexing into arrays), which would just be syntactic
sugar for what you're doing above;

- Eliminating sub-binaries by replacing their
selection with indexing as above ... but done
automatically. Something for a high level optimizer


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard. 

More information about the erlang-questions mailing list