D - Operator overloading
- Matthias Becker (4/4) Nov 05 2003 I'm sure this was discussed before, but I haven't been on this group for...
- Ant (3/7) Nov 05 2003 I have the same question.
- Charles Sanders (11/21) Nov 05 2003 I agree on this one also, just some ideas but if not operator foo someth...
- Ant (7/12) Nov 05 2003 I think I like it.
- Charles Sanders (5/21) Nov 05 2003 Good thinking, the alias doesnt like operators though :(.
- Elias Martenson (8/15) Nov 06 2003 Wouldn't this be terribly hard on the parser?
-
Carlos Santander B.
(30/30)
Nov 05 2003
"Matthias Becker"
wrote in message - Walter (7/11) Nov 05 2003 long
- Matthias Spycher (7/18) Nov 05 2003 I've been lurking here for a year or more, enjoying the fact that this p...
- Charles Sanders (12/36) Nov 05 2003 This sounds good ( prefixing with op ), I just dont like the word ass
- Walter (9/14) Nov 05 2003 project
- Sean L. Palmer (13/27) Nov 05 2003 Better to upset it earlier, than later, unless by doing it too early you...
- Matthew Wilson (9/40) Nov 05 2003 Agreed.
- Charles Sanders (6/52) Nov 05 2003 In Other Words. Thirded!
- Walter (7/14) Nov 05 2003 end
- Luna Kid (8/24) Nov 06 2003 Please, never hesitate about this under 1.00 ;)
- Matthew Wilson (7/32) Nov 06 2003 Absolutely. Break now is *always* better than crap later
I'm sure this was discussed before, but I haven't been on this group for a long time. So could somebody explain me, why names are used instead of the C++ like operator foo? To me it's much more intuitiv to write "operator +=" instead of "addass".
Nov 05 2003
In article <bob3sq$2n8p$1 digitaldaemon.com>, Matthias Becker says...I'm sure this was discussed before, but I haven't been on this group for a long time. So could somebody explain me, why names are used instead of the C++ like operator foo? To me it's much more intuitiv to write "operator +=" instead of "addass".I have the same question. Ant
Nov 05 2003
I agree on this one also, just some ideas but if not operator foo something like __+=__ () { } __++__ () { } A little pythonesque ? C "Ant" <Ant_member pathlink.com> wrote in message news:bob4r4$2oo1$1 digitaldaemon.com...In article <bob3sq$2n8p$1 digitaldaemon.com>, Matthias Becker says...a longI'm sure this was discussed before, but I haven't been on this group forliketime. So could somebody explain me, why names are used instead of the C++instead ofoperator foo? To me it's much more intuitiv to write "operator +=""addass".I have the same question. Ant
Nov 05 2003
In article <bobc3l$2rt$1 digitaldaemon.com>, Charles Sanders says...I agree on this one also, just some ideas but if not operator foo something like __+=__ () { } __++__ () { } A little pythonesque ?I think I like it. (never though I would say that about "_") Can we do: alias addass __+=__; or someting like that? Ant
Nov 05 2003
Good thinking, the alias doesnt like operators though :(. C "Ant" <Ant_member pathlink.com> wrote in message news:bobdkv$56l$1 digitaldaemon.com...In article <bobc3l$2rt$1 digitaldaemon.com>, Charles Sanders says...somethingI agree on this one also, just some ideas but if not operator foolike __+=__ () { } __++__ () { } A little pythonesque ?I think I like it. (never though I would say that about "_") Can we do: alias addass __+=__; or someting like that? Ant
Nov 05 2003
Charles Sanders wrote:I agree on this one also, just some ideas but if not operator foo something like __+=__ () { } __++__ () { } A little pythonesque ?Wouldn't this be terribly hard on the parser? Is't __ a legal symbol today? Wouldn't the parser have to scan 2 or 3 tokens ahead in order to determine if the initial __ is part of an expression or an overloading method? That would in turn break LALR? Granted, I never looked at the D parser so I could be just talking crap here. :-) Elias
Nov 06 2003
"Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bob3sq$2n8p$1 digitaldaemon.com... | I'm sure this was discussed before, but I haven't been on this group for a long | time. So could somebody explain me, why names are used instead of the C++ like | operator foo? To me it's much more intuitiv to write "operator +=" instead of | "addass". | | Over a year ago (about june-august 2002) there was a votation about this, and that was the winning convention. ————————————————————————— Carlos Santander "Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bob3sq$2n8p$1 digitaldaemon.com... | I'm sure this was discussed before, but I haven't been on this group for a long | time. So could somebody explain me, why names are used instead of the C++ like | operator foo? To me it's much more intuitiv to write "operator +=" instead of | "addass". | | Over a year ago (about june-august 2002) there was a votation about this, and that was the winning convention. ————————————————————————— Carlos Santander
Nov 05 2003
"Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bob3sq$2n8p$1 digitaldaemon.com...I'm sure this was discussed before, but I haven't been on this group for alongtime. So could somebody explain me, why names are used instead of the C++likeoperator foo? To me it's much more intuitiv to write "operator +=" insteadof"addass".The reason is because of the ability to write the reverse operator overloads, and to make the overloads easilly greppable.
Nov 05 2003
I've been lurking here for a year or more, enjoying the fact that this project is progressing steadily. Keep up the good work, Walter and everyone else. As for operator overloading, I like the naming convention, but I think all names should be prefixed with op, as in opCall to make it clear we are dealing with operators. Names like add are actually quite common, e.g. in collection classes. Matthias In article <bobi49$cde$1 digitaldaemon.com>, Walter says..."Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bob3sq$2n8p$1 digitaldaemon.com...I'm sure this was discussed before, but I haven't been on this group for alongtime. So could somebody explain me, why names are used instead of the C++likeoperator foo? To me it's much more intuitiv to write "operator +=" insteadof"addass".The reason is because of the ability to write the reverse operator overloads, and to make the overloads easilly greppable.
Nov 05 2003
This sounds good ( prefixing with op ), I just dont like the word ass everywhere in my code. C "Matthias Spycher" <matthias coware.com> wrote in message news:bobmno$jge$1 digitaldaemon.com...I've been lurking here for a year or more, enjoying the fact that thisprojectis progressing steadily. Keep up the good work, Walter and everyone else. As for operator overloading, I like the naming convention, but I think allnamesshould be prefixed with op, as in opCall to make it clear we are dealingwithoperators. Names like add are actually quite common, e.g. in collectionclasses.Matthias In article <bobi49$cde$1 digitaldaemon.com>, Walter says...for a"Matthias Becker" <Matthias_member pathlink.com> wrote in message news:bob3sq$2n8p$1 digitaldaemon.com...I'm sure this was discussed before, but I haven't been on this groupC++longtime. So could somebody explain me, why names are used instead of theinsteadlikeoperator foo? To me it's much more intuitiv to write "operator +="of"addass".The reason is because of the ability to write the reverse operator overloads, and to make the overloads easilly greppable.
Nov 05 2003
"Matthias Spycher" <matthias coware.com> wrote in message news:bobmno$jge$1 digitaldaemon.com...I've been lurking here for a year or more, enjoying the fact that thisprojectis progressing steadily. Keep up the good work, Walter and everyone else.Thanks!As for operator overloading, I like the naming convention, but I think allnamesshould be prefixed with op, as in opCall to make it clear we are dealingwithoperators. Names like add are actually quite common, e.g. in collectionclasses. You're right, I've been intending to do this, but I hate upsetting existing code.
Nov 05 2003
Better to upset it earlier, than later, unless by doing it too early you end up causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breaking code at this phase is not a big deal. Better to get the language right, than to be backward compatible with an initial concept that turns out not to work well in practice. IOW, don't be afraid to break stuff. Sean "Walter" <walter digitalmars.com> wrote in message news:bochg5$1rtc$3 digitaldaemon.com..."Matthias Spycher" <matthias coware.com> wrote in message news:bobmno$jge$1 digitaldaemon.com...else.I've been lurking here for a year or more, enjoying the fact that thisprojectis progressing steadily. Keep up the good work, Walter and everyoneThanks!allAs for operator overloading, I like the naming convention, but I thinknamesexistingshould be prefixed with op, as in opCall to make it clear we are dealingwithoperators. Names like add are actually quite common, e.g. in collectionclasses. You're right, I've been intending to do this, but I hate upsettingcode.
Nov 05 2003
Agreed. btw, what's IOW? :) "Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bockub$2103$1 digitaldaemon.com...Better to upset it earlier, than later, unless by doing it too early youendup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breakingcodeat this phase is not a big deal. Better to get the language right, thantobe backward compatible with an initial concept that turns out not to work well in practice. IOW, don't be afraid to break stuff. Sean "Walter" <walter digitalmars.com> wrote in message news:bochg5$1rtc$3 digitaldaemon.com...dealing"Matthias Spycher" <matthias coware.com> wrote in message news:bobmno$jge$1 digitaldaemon.com...else.I've been lurking here for a year or more, enjoying the fact that thisprojectis progressing steadily. Keep up the good work, Walter and everyoneThanks!allAs for operator overloading, I like the naming convention, but I thinknamesshould be prefixed with op, as in opCall to make it clear we arecollectionwithoperators. Names like add are actually quite common, e.g. inclasses. You're right, I've been intending to do this, but I hate upsettingexistingcode.
Nov 05 2003
In Other Words. Thirded! "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message news:boclem$21vv$1 digitaldaemon.com...Agreed. btw, what's IOW? :) "Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bockub$2103$1 digitaldaemon.com...workBetter to upset it earlier, than later, unless by doing it too early youendup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breakingcodeat this phase is not a big deal. Better to get the language right, thantobe backward compatible with an initial concept that turns out not tothiswell in practice. IOW, don't be afraid to break stuff. Sean "Walter" <walter digitalmars.com> wrote in message news:bochg5$1rtc$3 digitaldaemon.com..."Matthias Spycher" <matthias coware.com> wrote in message news:bobmno$jge$1 digitaldaemon.com...I've been lurking here for a year or more, enjoying the fact thatthinkprojectelse.is progressing steadily. Keep up the good work, Walter and everyoneThanks!As for operator overloading, I like the naming convention, but Ialldealingnamesshould be prefixed with op, as in opCall to make it clear we arecollectionwithoperators. Names like add are actually quite common, e.g. inclasses. You're right, I've been intending to do this, but I hate upsettingexistingcode.
Nov 05 2003
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bockub$2103$1 digitaldaemon.com...Better to upset it earlier, than later, unless by doing it too early youendup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breakingcodeat this phase is not a big deal. Better to get the language right, thantobe backward compatible with an initial concept that turns out not to work well in practice. IOW, don't be afraid to break stuff.Ok, I guess it will be in the next version. I really do hate breaking things.
Nov 05 2003
"Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bockub$2103$1 digitaldaemon.com...Please, never hesitate about this under 1.00 ;) I guess the D users, who are supposed to be on the losing side when this happens, would unanimously vote for "please break our experimental code!" rather than "please freeze little annoyances and limit our future production code/style!". Cheers, Sz.Better to upset it earlier, than later, unless by doing it too early youendup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breakingcodeat this phase is not a big deal. Better to get the language right, thantobe backward compatible with an initial concept that turns out not to work well in practice. IOW, don't be afraid to break stuff.Ok, I guess it will be in the next version. I really do hate breaking things.
Nov 06 2003
Absolutely. Break now is *always* better than crap later "Luna Kid" <lunakid neuropolis.org> wrote in message news:bodgvp$a4l$1 digitaldaemon.com...you"Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bockub$2103$1 digitaldaemon.com...Better to upset it earlier, than later, unless by doing it too earlybreakingendup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, sothancodeat this phase is not a big deal. Better to get the language right,worktobe backward compatible with an initial concept that turns out not toPlease, never hesitate about this under 1.00 ;) I guess the D users, who are supposed to be on the losing side when this happens, would unanimously vote for "please break our experimental code!" rather than "please freeze little annoyances and limit our future production code/style!". Cheers, Sz.well in practice. IOW, don't be afraid to break stuff.Ok, I guess it will be in the next version. I really do hate breaking things.
Nov 06 2003