It is your profile?
http://www.cyberforum.ru/members/491746.html
This is a bug?
import std.stdio;
void main() {
int a = 0;
writeln( (a 10) ? a = 1 : a = 2 );// prints 2
writeln( (a 10) ? a = 1 : (a = 2) ); // prints 1
}
Even C++ output:
1
1
On Friday, 13 February 2015 at 09:38:04 UTC, Dennis Ritchie wrote:
This is a bug?
import std.stdio;
void main() {
int a = 0;
writeln( (a 10) ? a = 1 : a = 2 );// prints 2
writeln( (a 10) ? a = 1 : (a = 2) ); // prints 1
}
Even C++ output:
1
1
Maybe a similar issue as
On Friday, 13 February 2015 at 13:25:55 UTC, Steven Schveighoffer
wrote:
On 2/13/15 7:38 AM, tcak wrote:
On Friday, 13 February 2015 at 09:38:04 UTC, Dennis Ritchie
wrote:
This is a bug?
import std.stdio;
void main() {
int a = 0;
writeln( (a 10) ? a = 1 : a = 2 );// prints 2
On Friday, 13 February 2015 at 13:25:55 UTC, Steven Schveighoffer
wrote:
Yes, the operator precedence (curiously not defined in the
spec) is here:
http://wiki.dlang.org/Operator_precedence
Conditional operator is above assignment operators.
It's specified through the grammar [1]:
On 2/13/15 7:38 AM, tcak wrote:
On Friday, 13 February 2015 at 09:38:04 UTC, Dennis Ritchie wrote:
This is a bug?
import std.stdio;
void main() {
int a = 0;
writeln( (a 10) ? a = 1 : a = 2 );// prints 2
writeln( (a 10) ? a = 1 : (a = 2) ); // prints 1
}
Even C++ output:
On 2/13/15 9:01 AM, anonymous wrote:
On Friday, 13 February 2015 at 13:25:55 UTC, Steven Schveighoffer wrote:
Yes, the operator precedence (curiously not defined in the spec) is here:
http://wiki.dlang.org/Operator_precedence
Conditional operator is above assignment operators.
It's
On Friday, 13 February 2015 at 09:38:04 UTC, Dennis Ritchie wrote:
This is a bug?
import std.stdio;
void main() {
int a = 0;
writeln( (a 10) ? a = 1 : a = 2 );// prints 2
writeln( (a 10) ? a = 1 : (a = 2) ); // prints 1
}
Even C++ output:
1
1
About 2 years ago, I had a