Hi,
I have a design question, or maybe it is a bug ? In D, == and != have
the same precedence than comparisons operators. This isn't the case in
C/C++ . Is it a design decision, made on purpose ? Is it a bug ?
DMD implementation and http://dlang.org/expression.html both agree on that.
I pers
Probably a good way to force parentesys usage and avoid subtle
bugs...
On Monday, 2 April 2012 at 10:01:20 UTC, deadalnix wrote:
Hi,
I have a design question, or maybe it is a bug ? In D, == and
!= have the same precedence than comparisons operators. This
isn't the case in C/C++ . Is it a de
On Mon, 02 Apr 2012 12:03:14 +0200, deadalnix wrote:
Hi,
I have a design question, or maybe it is a bug ? In D, == and != have
the same precedence than comparisons operators. This isn't the case in
C/C++ . Is it a design decision, made on purpose ? Is it a bug ?
DMD implementation and ht
On 02/04/2012 11:32, Simen Kjaeraas wrote:
On Mon, 02 Apr 2012 12:03:14 +0200, deadalnix wrote:
I have a design question, or maybe it is a bug ? In D, == and != have the same
precedence than comparisons operators. This isn't the case in C/C++ . Is it a
design
decision, made on purpose ? Is it
Le 02/04/2012 13:10, Stewart Gordon a écrit :
On 02/04/2012 11:32, Simen Kjaeraas wrote:
On Mon, 02 Apr 2012 12:03:14 +0200, deadalnix
wrote:
I have a design question, or maybe it is a bug ? In D, == and != have
the same
precedence than comparisons operators. This isn't the case in C/C++ .
Is
Parentesys are needed only where there's ambiguity with
precedence.
a > b > c is ambiguous (we need parentesys)
a == b > c is amibiguous (we need parentesys because == and >
have the same precedence)
a == b && c is not ambiguous ( && and == haven't the same
precedence so we don't need paren
On 4/2/2012 5:04 AM, deadalnix wrote:
So basically, the precedence doesn't matter because any situation where it
matter is illegal anyway ?
That's correct and neatly sums up the situation.
Le 02/04/2012 15:49, Walter Bright a écrit :
On 4/2/2012 5:04 AM, deadalnix wrote:
So basically, the precedence doesn't matter because any situation
where it
matter is illegal anyway ?
That's correct and neatly sums up the situation.
Merci :D