[erlang-questions] bit syntax: what does "<<1234>> =" match?

Robert Virding robert.virding@REDACTED
Mon Feb 28 01:40:38 CET 2011

----- "Anthony Ramine" <nox@REDACTED> wrote:

> Le 26 févr. 2011 à 20:28, Robert Virding a écrit :
> > One of the cool things with binaries is that there is no info in the
> binary saying how it was created so I can do lots of fun things when I
> pull it apart.
> > 
> > Robert
> While it may be cool, I think the compiler should issue a warning when
> an impossible pattern is encountered. 1234 is obviously not
> representable with only 8 bits.

The coolness was not an impossible pattern, I agree that the compiler should warn, but more the fact that you can pull apart a binary differently from how it was constructed. It is with that you can do cool things.


Robert Virding, Erlang Solutions Ltd.

More information about the erlang-questions mailing list