Re: dmd-2.067.0-b1

2015-02-14 Thread RuZzz via Digitalmars-d-learn
It is your profile? http://www.cyberforum.ru/members/491746.html

dmd-2.067.0-b1

2015-02-13 Thread Dennis Ritchie via Digitalmars-d-learn
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

Re: dmd-2.067.0-b1

2015-02-13 Thread Gary Willoughby via Digitalmars-d-learn
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

Re: dmd-2.067.0-b1

2015-02-13 Thread Dennis Ritchie via Digitalmars-d-learn
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

Re: dmd-2.067.0-b1

2015-02-13 Thread anonymous via Digitalmars-d-learn
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]:

Re: dmd-2.067.0-b1

2015-02-13 Thread Steven Schveighoffer via Digitalmars-d-learn
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:

Re: dmd-2.067.0-b1

2015-02-13 Thread Steven Schveighoffer via Digitalmars-d-learn
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

Re: dmd-2.067.0-b1

2015-02-13 Thread tcak via Digitalmars-d-learn
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