Erlang bit syntax variable issue

Posted by Jimmy Ruska on Stack Overflow See other posts from Stack Overflow or by Jimmy Ruska
Published on 2010-03-19T19:10:01Z Indexed on 2010/03/19 19:11 UTC
Read the original article Hit count: 153

Filed under:

Is there any way to format this so it's a valid expression, without adding another step?

<<One:8,_:(One*8)>> = <<1,9>>.
* 1: illegal bit size

These work

<<One:8,_:(1*8)>> = <<1,9>>.
<<1,9>>

<<Eight:8,_:Eight>> = <<8,9>>.  
<<8,9>>

I'm trying to parse a binary with nested data with list comprehensions instead of stacking accumulators.

© Stack Overflow or respective owner

Related posts about erlang