[erlang-questions] That's why?

Henning Diedrich hd2010@REDACTED
Sat May 15 04:25:57 CEST 2010


I may fancy that 3+2 is optimized to a literal number 5 at compile time, 
which is as unbreakable as the plain reference to A in the first example.

Doing anything more complex may not have been reconcilable with the 
optimizations applied to pattern matching.

That's how I am comforting myself when running into little amendable 
guards and this very issue of byte sizes you are raising.

Henning

catsunny2010 wrote:
> Hi all,
>
> I know I can,
>
> <<A:8, B:(A)/binary, _/binary>> = <<..>>
>
> and I can,
>
> <<A:8, B:(3+2)/binary, _/binary>> = <<...>>
>
> But why cannot I,
>
> <<A:8, B:(A+2)/binary, _/binary>> = <<...>> ???
>
> Thank you!
> catsunny2010
>
>
>
>
>
>
>
> ________________________________________________________________
> 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