Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 06, 2013 Operator Precedence and Associativity | ||||
---|---|---|---|---|
| ||||
I’m sure the following table is missing a few items but am unclear what they are. For starters these <>, <>=, >>>, , !<>, !<>= belong on the table but I’m not sure where. I am also not sure if these ..., @, # belong there at all. There might be other errors or missing operators. Request assist to complete correctly. Operator Precedence and Associativity Rules in D ——————————————————————————————————————————————————————————————————— ! template instantiation ——————————————————————————————————————————————————————————————————— => lambda right-to-left ——————————————————————————————————————————————————————————————————— () function call left-to-right [] array element . member selection ++ post increment right-to-left -- post decrement ——————————————————————————————————————————————————————————————————— ! logical not right-to-left ~ bitwise complement - unary minus ++ pre increment -- pre decrement * contents of (dereference) new ref in !in out inout cast() is !is ——————————————————————————————————————————————————————————————————— ^^ power left-to-right * multiply / divide % remainder ——————————————————————————————————————————————————————————————————— + add left-to-right - subtract ——————————————————————————————————————————————————————————————————— << bitwise left shift left-to-right >> bitwise right shift ——————————————————————————————————————————————————————————————————— < arithmetic less than left-to-right !>= arithmetic not greater than or equal to > arithmetic greater than !<= arithmetic not less than or equal to <= arithmetic less than or equal to !> arithmetic not greater than >= arithmetic greater than or equal to !< arithmetic not less than ——————————————————————————————————————————————————————————————————— == arithmetic equal left-to-right != arithmetic not equal ——————————————————————————————————————————————————————————————————— & bitwise and left-to-right ——————————————————————————————————————————————————————————————————— ^ bitwise exclusive or left-to-right ——————————————————————————————————————————————————————————————————— | bitwise or left-to-right ——————————————————————————————————————————————————————————————————— && logical and left-to-right ——————————————————————————————————————————————————————————————————— || logical or left-to-right ——————————————————————————————————————————————————————————————————— ? : conditional expression right-to-left ——————————————————————————————————————————————————————————————————— = assignment operator right-to-left also += -= *= /= %= <<= >>= &= ^= |= ~= ^^= >>>= ——————————————————————————————————————————————————————————————————— => lambda left-to-right ——————————————————————————————————————————————————————————————————— , sequential expression left-to-right ——————————————————————————————————————————————————————————————————— .. range separator ——————————————————————————————————————————————————————————————————— -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = "@", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); } |
November 06, 2013 Re: Operator Precedence and Associativity | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tyro[17] | On Tuesday, November 05, 2013 22:34:49 Tyro[17] wrote: > I’m sure the following table is missing a few items but am unclear > what they are. For starters these <>, <>=, >>>, , !<>, !<>= > belong on the table but I’m not sure where. I'm not quite sure where they go, but I believe that all of them (save maybe >>>) are supposed to be deprecated, in which case, it matters a lot less where they'd go in the table. - Jonathan M Davis |
November 06, 2013 Re: Operator Precedence and Associativity | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tyro[17] | On 11/06/2013 04:34 AM, Tyro[17] wrote: > I’m sure the following table is missing a few items but am unclear > what they are. For starters these <>, <>=, >>>, , !<>, !<>= > belong on the table but I’m not sure where. I am also not sure if > these ..., @, # belong there at all. There might be other errors > or missing operators. Request assist to complete correctly. > ... I have some time ago compiled my own table, which can be found here: http://wiki.dlang.org/Operator_precedence |
November 08, 2013 Re: Operator Precedence and Associativity | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On 11/5/13, 11:36 PM, Jonathan M Davis wrote:
> On Tuesday, November 05, 2013 22:34:49 Tyro[17] wrote:
>> I’m sure the following table is missing a few items but am unclear
>> what they are. For starters these <>, <>=, >>>, , !<>, !<>=
>> belong on the table but I’m not sure where.
>
> I'm not quite sure where they go, but I believe that all of them (save maybe
>>>> ) are supposed to be deprecated, in which case, it matters a lot less where
> they'd go in the table.
>
> - Jonathan M Davis
>
OK thanks. As for the actual chart, I take it there wasn't anything glaringly wrong with what's already in it?
Andrew
|
November 08, 2013 Re: Operator Precedence and Associativity | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 11/6/13, 6:43 AM, Timon Gehr wrote:
> On 11/06/2013 04:34 AM, Tyro[17] wrote:
>> I’m sure the following table is missing a few items but am unclear
>> what they are. For starters these <>, <>=, >>>, , !<>, !<>=
>> belong on the table but I’m not sure where. I am also not sure if
>> these ..., @, # belong there at all. There might be other errors
>> or missing operators. Request assist to complete correctly.
>> ...
>
> I have some time ago compiled my own table, which can be found here:
> http://wiki.dlang.org/Operator_precedence
>
>
Thanks. Did not see this earlier. I will compare my list and adjust accordingly.
|
Copyright © 1999-2021 by the D Language Foundation