[erlang-questions] Reading fixed structures from file

Gleb Peregud gleber.p@REDACTED
Mon Mar 3 20:03:18 CET 2008


Thanks a lot for clarifying this!

On 3/3/08, Dave Smith <dizzyd@REDACTED> wrote:
> On Sat, Mar 1, 2008 at 2:37 PM, Gleb Peregud <gleber.p@REDACTED> wrote:
> > Thanks a lot.
> >
> >  imho my code is more readable :) But it's matter of taste.
> >
> >  Nevertheless, to avoid confusion, i'll ask explicitly:
> >
> >
> >  Key:4/little-integer-unit:8
> >
> >  matches four integers each having 8 bits, right?
>
> No. You could read that line as:
>
> "Key" is a 4-unit little-endian integer, where each unit has 8 bits.
>
> You could also write:
>
> Key:16/little-integer:2 or Key:8/little-integer-unit:4 or .....
>
> Hope that helps.
>
> D.
>


-- 
Gleb Peregud
http://gleber.pl/

"Only two things are infinite, the universe and human stupidity, and
I'm not sure about the former."
--  Albert Einstein



More information about the erlang-questions mailing list