digitalmars.D.learn - Operator Precedence and Associativity
- Tyro[17] (87/87) Nov 05 2013 I’m sure the following table is missing a few items but am unclear
- Jonathan M Davis (7/11) Nov 05 2013 I'm not quite sure where they go, but I believe that all of them (save =
- Tyro[17] (4/12) Nov 07 2013 OK thanks. As for the actual chart, I take it there wasn't anything
- Timon Gehr (3/9) Nov 06 2013 I have some time ago compiled my own table, which can be found here:
- Tyro[17] (3/12) Nov 07 2013 Thanks. Did not see this earlier. I will compare my list and adjust
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 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"); }
Nov 05 2013
On Tuesday, November 05, 2013 22:34:49 Tyro[17] wrote:I=E2=80=99m sure the following table is missing a few items but am un=clearwhat they are. For starters these <>, <>=3D, >>>, , !<>, !<>=3D belong on the table but I=E2=80=99m not sure where.I'm not quite sure where they go, but I believe that all of them (save = maybe=20s where=20 they'd go in the table. - Jonathan M Davis) are supposed to be deprecated, in which case, it matters a lot les=
Nov 05 2013
On 11/5/13, 11:36 PM, Jonathan M Davis wrote:On Tuesday, November 05, 2013 22:34:49 Tyro[17] wrote:OK thanks. As for the actual chart, I take it there wasn't anything glaringly wrong with what's already in it? AndrewI’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 maybethey'd go in the table. - Jonathan M Davis) are supposed to be deprecated, in which case, it matters a lot less where
Nov 07 2013
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 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
Nov 06 2013
On 11/6/13, 6:43 AM, Timon Gehr wrote:On 11/06/2013 04:34 AM, Tyro[17] wrote:Thanks. Did not see this earlier. I will compare my list and adjust accordingly.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 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
Nov 07 2013