[erlang-questions] Binaries in records syntax error

Robert Virding rvirding@REDACTED
Sat Jul 31 03:22:18 CEST 2010


It's not just setting binaries in records, you always need a space
between an '=' and the << otherwise the parser groups them
incorrectly. So:

X=<<1,2,3>>,                 %This is BAD

will cause the same error. You need to write:

X = <<1,2,3>>

There is nothing really which can be done about this as you scan from
left-to-right.

Robert

On 31 July 2010 00:59, James Aimonetti <james.aimonetti@REDACTED> wrote:
> If setting raw binaries into records, a space is important between the
> binding and the start of the binary.
>
> #foo{bar=<<"something">>} causes a "syntax error before: '=<' " during
> compilation.
>
> #foo{bar= <<"something">>} is fine.
>
> Caught me by surprise. FYI
>
> James
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>


More information about the erlang-questions mailing list