bit syntax documentation

Ulf Wiger etxuwig@REDACTED
Tue Apr 3 17:18:32 CEST 2001

In the documentation for the bit syntax, I read the following:

"A segment of type binary must have a size evenly divisible by 8. 

     This means that the following head will never match: 

     foo(<<X:7/binary,Y:1/binary>>) ->"


Since my code didn't work as expected, I tried to verify this:

30> F = fun(<<X:7/binary,Y:1/binary>>) -> {X,Y}; (Other) -> Other
31> F(<<"12345678">>).                                                     

In other words, the head described in the manual matches just fine.


Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB

More information about the erlang-questions mailing list