On Saturday, 7 April 2018 at 14:28:05 UTC, kdevel wrote:
On Saturday, 7 April 2018 at 09:56:43 UTC, Jonathan M Davis
Assignment takes precendence over the ternary operator.
That's not true. Not in D and not in C/C++
The odd man out is C++ , assignment has higher precedence
because of right to left evaluation. Do not mix it with C please.
All other C derived languages have indeed higher precedence for
ternary than assignment: C , java , C#  and D .
So, no, I don't think that it is. Putting parens around the
assignment expressions makes it print AA.
It should not matter if there are parens around the assignment.
As it stands, it evaluates both assignment expressions before
evaluating the ternary operator.
That is not true in C/C++, let me quote from a C standard
(draft), § 6.1.5 conditional operator:
Stop mixing C with C++ they are really 2 very different beasts
(one is a programming language, the other is Cthulu :-)