Concerning erlang's bit syntax
Tue Nov 4 14:41:31 CET 2003
Works fine for me.
Are you sure compiled the module with a R9C compiler?
(It will now work with previous releases.)
Magnus Thoang <magnus.thoang@REDACTED> writes:
> I like erlang's bit syntax. It makes my life easier in almost all
> situations where I need to shuffle bytes around.
> I was surprised, though, when the code I had ran in the erlang shell
> had to be rewritten for the compiler:
> This matching works (R9C) in the shell but cannot be put in a module:
> <<StrSize:32,Str:StrSize/binary,Rest/binary>> =
> When trying to compile the above expression, the compiler gives an
> error about StrSize being unbound (in the 'Str:StrSize/binary'
> The documentation is not clear about this case, but it mentions a
> somewhat similar function head as not being allowed.
> It is just a minor annoyance, but is there a good reason for this?
> Magnus Thoäng
Björn Gustavsson Ericsson Utvecklings AB
+46 8 727 56 87 125 25 Älvsjö
More information about the erlang-questions