zero length segments!

Vance Shipley vances@REDACTED
Tue Sep 24 12:33:23 CEST 2002


Was I ever happily suprised when I found that this was a valid expression:

	<<0:8, 1:24, 0:0>>

It results in:

	<<0,0,0,1>>

The reason this is so good is that it I don't have to handle a special
case when X=0:

	Flag = <<_:(31-X), Flag:1, _:(X)>>

Of course I'm sure that that is why it works, I'm just very happy about it. :)

	-Vance



More information about the erlang-questions mailing list