[erlang-questions] bit operations/matching

Pieter Erlang <>
Thu May 8 19:02:49 CEST 2008


Hi,

Can someone explain why line 2 fails (and line 3 not)?
(also reproducible in other ways)

Thx
Pieter
PS. unfortunately and only temporarily running on windows xp


Erlang (BEAM) emulator version 5.6.2 [async-threads:0]

Eshell V5.6.2 (abort with ^G)
1> B = <<0:1000>>.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,...>>
2> <<_:80,Val:2,_/binary>> = B.
** exception error: no match of right hand side value
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,...>>
3> <<_:80,Val:8,_/binary>> = B.
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,...>>
4>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080508/0be1102b/attachment.html>


More information about the erlang-questions mailing list