digitalmars.D.bugs - Deprecated cast bug
- Ilya Zaitseff (6/6) Jul 25 2004 void main()
-
Walter
(4/10)
Jul 26 2004
Such parsing ambiguities are why C style casts are deprecated
. (It i... - Derek Parnell (8/20) Jul 26 2004 Does this mean the we can never have the construct ...
- Walter (6/22) Jul 26 2004 is
- Stewart Gordon (9/22) Jul 27 2004 I personally don't see much difficulty in trying to parse it as an
- Walter (6/23) Jul 27 2004 never
- Jarrett Billingsley (2/2) Jul 26 2004 if the "unary plus" operator didn't exist, we wouldn't have this problem...
- Walter (4/6) Jul 26 2004 ;)
- Arcane Jill (3/8) Jul 27 2004 Cool. What would you call it though? opDoNothing()? opTrivial()?
- Walter (4/12) Jul 27 2004 problem
- James McComb (6/9) Jul 27 2004 Just a feeling... UnaryAdd feels a bit "technical" for me.
- Arcane Jill (6/7) Jul 27 2004 Well, actually, we'd still have the problem with unary minus.
- Jarrett Billingsley (1/2) Jul 27 2004 agh forgot about that one..
- Ivan Senji (11/19) Aug 06 2004 ;)
void main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)
Jul 25 2004
"Ilya Zaitseff" <sark7 mail333.com> wrote in message news:opsbpwecsuaaezs2 ilya.tec.amursk.ru...void main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)Such parsing ambiguities are why C style casts are deprecated <g>. (It is parsed as (i)(+j), i.e. the + is seen as the unary plus operator.)
Jul 26 2004
On Mon, 26 Jul 2004 10:07:28 -0700, Walter wrote:"Ilya Zaitseff" <sark7 mail333.com> wrote in message news:opsbpwecsuaaezs2 ilya.tec.amursk.ru...Does this mean the we can never have the construct ... '(' <identifier> ')' <operand> <expression> in D? -- Derek Melbourne, Australia 27/Jul/04 11:33:09 AMvoid main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)Such parsing ambiguities are why C style casts are deprecated <g>. (It is parsed as (i)(+j), i.e. the + is seen as the unary plus operator.)
Jul 26 2004
"Derek Parnell" <derek psych.ward> wrote in message news:ce4bgd$1lir$1 digitaldaemon.com...On Mon, 26 Jul 2004 10:07:28 -0700, Walter wrote:is"Ilya Zaitseff" <sark7 mail333.com> wrote in message news:opsbpwecsuaaezs2 ilya.tec.amursk.ru...void main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)Such parsing ambiguities are why C style casts are deprecated <g>. (ItYou will once I take out C style casts completely. But unlike C, you never need to enclose an identifier in redundant parens, so it isn't a problem. (It's needed in C because of macro arguments.)parsed as (i)(+j), i.e. the + is seen as the unary plus operator.)Does this mean the we can never have the construct ... '(' <identifier> ')' <operand> <expression> in D?
Jul 26 2004
Walter wrote:<snip>"Ilya Zaitseff" <sark7 mail333.com> wrote in message news:opsbpwecsuaaezs2 ilya.tec.amursk.ru...void main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)You will once I take out C style casts completely. But unlike C, you never need to enclose an identifier in redundant parens, so it isn't a problem. (It's needed in C because of macro arguments.)I personally don't see much difficulty in trying to parse it as an AddExpression first ... but yes, getting rid of C casts is the way to go. Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Jul 27 2004
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:ce5bgk$22f6$1 digitaldaemon.com...Walter wrote:never<snip>"Ilya Zaitseff" <sark7 mail333.com> wrote in message news:opsbpwecsuaaezs2 ilya.tec.amursk.ru...void main() { int i, j; int k = (i)+j; } [dmd 0.96] outputs: C style cast deprecated, use cast(i)(j)You will once I take out C style casts completely. But unlike C, youproblem.need to enclose an identifier in redundant parens, so it isn't aConsider (identifier). Is identifier a type, or a variable? The parser doesn't know, as it does not do semantic analysis.(It's needed in C because of macro arguments.)I personally don't see much difficulty in trying to parse it as an AddExpression first ...
Jul 27 2004
if the "unary plus" operator didn't exist, we wouldn't have this problem ;) what the hell is it for anyway? jill wants to know too.
Jul 26 2004
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:ce4bnm$1lla$1 digitaldaemon.com...if the "unary plus" operator didn't exist, we wouldn't have this problem;)what the hell is it for anyway? jill wants to know too.For completeness. It should be overloadable, though.
Jul 26 2004
In article <ce4r8j$1s0a$1 digitaldaemon.com>, Walter says...Cool. What would you call it though? opDoNothing()? opTrivial()? Jill :)if the "unary plus" operator didn't exist, we wouldn't have this problem;)what the hell is it for anyway? jill wants to know too.For completeness. It should be overloadable, though.
Jul 27 2004
"Arcane Jill" <Arcane_member pathlink.com> wrote in message news:ce51g7$1v8s$1 digitaldaemon.com...In article <ce4r8j$1s0a$1 digitaldaemon.com>, Walter says...problemif the "unary plus" operator didn't exist, we wouldn't have thisopUnaryAdd();)Cool. What would you call it though? opDoNothing()? opTrivial()?what the hell is it for anyway? jill wants to know too.For completeness. It should be overloadable, though.
Jul 27 2004
Walter wrote:Just a feeling... UnaryAdd feels a bit "technical" for me. Since +5 is positive 5, and -5 is negative 5, what do you think of: opPositive for unary add opNegative for unary subtract James McCombCool. What would you call it though? opDoNothing()? opTrivial()?opUnaryAdd()
Jul 27 2004
In article <ce4bnm$1lla$1 digitaldaemon.com>, Jarrett Billingsley says...if the "unary plus" operator didn't exist, we wouldn't have this problem ;)Well, actually, we'd still have the problem with unary minus. This problem will go away in time, once C-style casts change from "deprecated" to "illegal". (But I'd still like to know what unary plus is for, given that we can't overload it to do anything useful). Jill
Jul 27 2004
Well, actually, we'd still have the problem with unary minus.agh forgot about that one..
Jul 27 2004
"Arcane Jill" <Arcane_member pathlink.com> wrote in message news:ce51c7$1v7j$1 digitaldaemon.com...In article <ce4bnm$1lla$1 digitaldaemon.com>, Jarrett Billingsley says...;)if the "unary plus" operator didn't exist, we wouldn't have this problemWell, actually, we'd still have the problem with unary minus. This problem will go away in time, once C-style casts change from"deprecated"to "illegal". (But I'd still like to know what unary plus is for, giventhat wecan't overload it to do anything useful).completeness! I can write: real x = +sin(angle)*W+cos(angle)*H; real y = -sin(angle)*W-cos(angle)*H; or something like that that makes sence. Now the first + makes the difference between x and y much clearer.Jill
Aug 06 2004