Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 19, 2002 dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
ftp://www.digitalmars.com/dmdalpha.zip www.digitalmars.com/d/operatoroverloading.html It doesn't do all the operators yet, but it's a start. -Walter |
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Great Job! "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com... > ftp://www.digitalmars.com/dmdalpha.zip > > www.digitalmars.com/d/operatoroverloading.html > > It doesn't do all the operators yet, but it's a start. > > -Walter > > |
August 19, 2002 Re: dmd 0.37 release - operator overloading (???) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | I don't understand point 4. "4. If a or b is a struct or class object reference, it is an error. " Do you mean? "4. If a and b is a struct or class object reference, it is an error. " If so do you plan on making class by class operations overloadable in a future? Can you add an example for 4.? "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com... > ftp://www.digitalmars.com/dmdalpha.zip > > www.digitalmars.com/d/operatoroverloading.html > > It doesn't do all the operators yet, but it's a start. > > -Walter > > |
August 19, 2002 Re: dmd 0.37 release - operator overloading (???) | ||||
---|---|---|---|---|
| ||||
Posted in reply to anderson | I believe that 4 is a fall-through if options 1-3 fail. If you've tried to use an operator, and the classes offer no way to relate them, then it is an error. anderson wrote: > I don't understand point 4. > > "4. If a or b is a struct or class object reference, it is an error. " > > Do you mean? > > "4. If a and b is a struct or class object reference, it is an error. " > > If so do you plan on making class by class operations overloadable in a future? > > Can you add an example for 4.? > > "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com... > > ftp://www.digitalmars.com/dmdalpha.zip > > > > www.digitalmars.com/d/operatoroverloading.html > > > > It doesn't do all the operators yet, but it's a start. > > > > -Walter > > > > -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ] |
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Very good! Now, on to the op= operators...since they are often much faster and memory efficient to implement :) In fact, in my mathematical classes in C++, I would often implement op as derived from op= . I would create a temporary copy of an object, use the op= function on that, and then return the temporary... Walter wrote: > ftp://www.digitalmars.com/dmdalpha.zip > > www.digitalmars.com/d/operatoroverloading.html > > It doesn't do all the operators yet, but it's a start. > > -Walter -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ] |
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to anderson | The neat thing is it turned out to be an amazingly small amount of code added to the source. -Walter "anderson" <anderson@firestar.com.au> wrote in message news:ajqtvc$rg0$1@digitaldaemon.com... > Great Job! > > "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com... > > ftp://www.digitalmars.com/dmdalpha.zip > > > > www.digitalmars.com/d/operatoroverloading.html > > > > It doesn't do all the operators yet, but it's a start. > > > > -Walter > > > > > > |
August 19, 2002 Re: dmd 0.37 release - operator overloading (???) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russ Lewis | "Russ Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D611181.FE5B9F74@deming-os.org... > I believe that 4 is a fall-through if options 1-3 fail. If you've tried to > use an operator, and the classes offer no way to relate them, then it is an > error. That's right. |
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter
I don't think it gets much simpler than that. I agree with anderson, good job!
-Jon
|
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | What happened to the nice Vector operator (Vector a) + (Vector b) {} syntax everyone was voting for? You figured out a way around the friend problem. Some things just don't properly belong in either class and should be sorta global. Sean "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com... > ftp://www.digitalmars.com/dmdalpha.zip > > www.digitalmars.com/d/operatoroverloading.html > > It doesn't do all the operators yet, but it's a start. > > -Walter |
August 19, 2002 Re: dmd 0.37 release - operator overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "where a is a class or struct object reference..." Did I miss something or are we getting concrete types (in C++ parlance) as well? All the examples show class and not struct so--maybe not yet? |
Copyright © 1999-2021 by the D Language Foundation