Traversing a binary

Thomas Lindgren thomasl_erlang@REDACTED
Wed Sep 22 10:51:18 CEST 2004


--- Erik Stenman <erik.stenman@REDACTED> 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
consider?

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
perhaps?

Best,
Thomas



		
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 



More information about the erlang-questions mailing list