Binary guards problem

Luke Gorrie luke@REDACTED
Mon Oct 23 12:07:24 CEST 2000


Sean Hinde <Sean.Hinde@REDACTED> writes:

> All,
> 
> There seems to be a small problem with binaries in R7B:
> 
> test(<<B/binary>>) when size(B) < 4 ->
> 	small;
> test(<<1, B/binary>>) ->
> 	large.
> 
> calling test(<<1, 2>>) returns large
> calling test(<<2, 2>>) returns small
> 
> It works fine in the debugger.. 

I've noticed another quirk, where for some cases "Bin1 = Bin2" fails
with a badmatch, but "true = Bin1 == Bin2" succeeds. Is this a bug? If
so I can send some code to reproduce it.

-Luke




More information about the erlang-questions mailing list