July 27, 2004 Re: Deprecated cast bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | "Arcane Jill" <Arcane_member@pathlink.com> wrote in message news:ce51g7$1v8s$1@digitaldaemon.com... > In article <ce4r8j$1s0a$1@digitaldaemon.com>, Walter says... > > >> 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. > > Cool. What would you call it though? opDoNothing()? opTrivial()? opUnaryAdd() |
July 27, 2004 Re: Deprecated cast bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | "Stewart Gordon" <smjg_1998@yahoo.com> wrote in message news:ce5bgk$22f6$1@digitaldaemon.com... > Walter wrote: > > >>> "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) > <snip> > > 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 ... Consider (identifier). Is identifier a type, or a variable? The parser doesn't know, as it does not do semantic analysis. |
July 28, 2004 Re: Deprecated cast bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
>>Cool. What would you call it though? opDoNothing()? opTrivial()?
>
> opUnaryAdd()
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 McComb
|
August 06, 2004 Re: Deprecated cast bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | "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 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). 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 > > > > |
Copyright © 1999-2021 by the D Language Foundation