Bit syntax frustrations, again

Sean Hinde <>
Thu Oct 3 20:15:43 CEST 2002


> I am working heavily with the bit syntax right now and my two cents
> on this matter is that it is unfortunate that I can't do this:
> 
> 	<<Header:32, Payload/binary, Trailer:16>> = Packet
> 
> It would make my life a lot easier.

And while we are at it what about unbound length parameters (like a basic
regexp search):

	1>f().
	ok
      2><<Line:Length/binary, 13, 10, Tail/binary>> =
<<"abcdef\r\nghijkl\r\n">>.
	<<97,98,99,100,101,102,13,10,103,104,105,106,107,108,13,10>>
	3>Line.
	<<97,98,99,100,101,102>>
	4>Length.
	6.
	5>Tail.
	<<103,104,105,106,107,108,13,10>>

This would make many applications much more elegant (not to mention a darn
site faster). I'm not quite sure what to do about nothing found.. probably
just exit(badmatch)

Sean



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list