On Monday, February 13, 2012 19:47:03 Artur Skawina wrote: > On 02/13/12 18:57, Jonathan M Davis wrote: > > On Sunday, February 12, 2012 10:07:52 Ali Çehreli wrote: > >> Related question: Does D define the order of evaluation in an > >> expression > >> like > >> > >> foo() ~ bar() > >> > >> Or is it unspecified as in C and C++? > > > > It's currently unspecified. Walter has stated that he wants to make it > > so that it's always left to right, but I don't believe that he's done > > it yet, and it may or may not ever happen. > > Actually, it *is* specified as left-to-right, except for assignments and > argument evaluation. http://dlang.org/expression.html > No idea if the compiler fully implements that part of the spec.
Well, foo() ~ bar() _is_ argument evaluation if you're dealing with an overloaded operator. And unfortunately, whether the spec is what the compiler does is frequently suspect anyway. So, who knows. - Jonathan M Davis