Evaluate postfix after assignment

Bergi a.d.bergi at web.de
Tue May 12 22:25:03 UTC 2015


Emanuel Allen schrieb:
> Typo. I'm worrying about this:
>
> arr[i++]=obj[e]
>
> arr[i++]//this will evaluate first before the value return since the = have a lower
> precedence than ++.

Notice that operator precedence has to do with parsing an (otherwise 
ambiguous) expression, not with evaulation order.

So this is parsed to

   (((arr)[((i)++)])=((obj)[(e)]))

and then basically evaluated left-to-right.

  Bergi


More information about the es-discuss mailing list