I don't evaluate that is the cause because it doesn't work for non-empty binaries either. Look at this:> ABC = <<"ABC">>. <<"ABC">>> A = <<"A">>. <<"A">>> <<A/binary. BC/binary>> = ABC. ** exited: {{badmatch,<<"ABC">>},[{erl_eval,expr,3}]} **And if I add the coat of the binary it now works:> <<A:1/binary. BC/binary>> = ABC. <<"ABC">>
I was expecting that this would result in 'follow' being bound to <<"ABC">> but instead I'm getting a badmatch error. However if I contract the length of the 'Empty' variable it works:<<alter:0/binary. follow/binary>> = A.
I suspect this is because empty binaries don't have a size so erlang can't cause the size for you meaning you have to explicitly specify a coat of 0 for erlang to figure out how to match it. Might be nice if it could evaluate out the 0 part itself but not neccessarily a bug. Maybe a Core developer could shed more light?
Forex Groups - Tips on Trading
Related article:
http://www.nabble.com/forum/ViewPost.jtp?post=13780397&framed=y
comments | Add comment | Report as Spam
|