D - Operator overloading
- Matthias Becker <Matthias_member pathlink.com> Nov 05 2003
- Ant <Ant_member pathlink.com> Nov 05 2003
- "Charles Sanders" <sanders-consulting comcast.net> Nov 05 2003
- Ant <Ant_member pathlink.com> Nov 05 2003
- Elias Martenson <elias-m algonet.se> Nov 06 2003
- "Carlos Santander B." <carlos8294 msn.com> Nov 05 2003
- "Walter" <walter digitalmars.com> Nov 05 2003
- Matthias Spycher <matthias coware.com> Nov 05 2003
- "Charles Sanders" <sanders-consulting comcast.net> Nov 05 2003
- "Walter" <walter digitalmars.com> Nov 05 2003
- "Sean L. Palmer" <palmer.sean verizon.net> Nov 05 2003
- "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> Nov 05 2003
- "Walter" <walter digitalmars.com> Nov 05 2003
- "Luna Kid" <lunakid neuropolis.org> Nov 06 2003
- "Matthew Wilson" <dmd synesis.com.au> Nov 06 2003
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...
I'm sure this was discussed before, but I haven't been on this group for
time. So could somebody explain me, why names are used instead of the C++
operator 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...I agree on this one also, just some ideas but if not operator foo
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
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 a
time. So could somebody explain me, why names are used instead of the C++
operator foo? To me it's much more intuitiv to write "operator +=" instead
"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 a
time. So could somebody explain me, why names are used instead of the C++
operator foo? To me it's much more intuitiv to write "operator +=" instead
"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 this
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
should be prefixed with op, as in opCall to make it clear we are dealing
operators. Names like add are actually quite common, e.g. in collection
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
longtime. So could somebody explain me, why names are used instead of the
likeoperator 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 this
is progressing steadily. Keep up the good work, Walter and everyone else.
Thanks!As for operator overloading, I like the naming convention, but I think all
should be prefixed with op, as in opCall to make it clear we are dealing
operators. Names like add are actually quite common, e.g. in collection
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...I've been lurking here for a year or more, enjoying the fact that this
is progressing steadily. Keep up the good work, Walter and everyone
Thanks!As for operator overloading, I like the naming convention, but I think
namesshould be prefixed with op, as in opCall to make it clear we are dealing
operators. Names like add are actually quite common, e.g. in collection
You're right, I've been intending to do this, but I hate upsetting
code.
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 you
up causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breaking
at this phase is not a big deal. Better to get the language right, than
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...I've been lurking here for a year or more, enjoying the fact that this
is progressing steadily. Keep up the good work, Walter and everyone
Thanks!As for operator overloading, I like the naming convention, but I think
namesshould be prefixed with op, as in opCall to make it clear we are
withoperators. Names like add are actually quite common, e.g. in
classes. You're right, I've been intending to do this, but I hate upsetting
code.
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...Better to upset it earlier, than later, unless by doing it too early you
up causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breaking
at this phase is not a big deal. Better to get the language right, than
be backward compatible with an initial concept that turns out not to
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...I've been lurking here for a year or more, enjoying the fact that
projectis progressing steadily. Keep up the good work, Walter and everyone
Thanks!As for operator overloading, I like the naming convention, but I
allnamesshould be prefixed with op, as in opCall to make it clear we are
withoperators. Names like add are actually quite common, e.g. in
classes. You're right, I've been intending to do this, but I hate upsetting
code.
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 you
up causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breaking
at this phase is not a big deal. Better to get the language right, than
be 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...Better to upset it earlier, than later, unless by doing it too early you
up causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so breaking
at this phase is not a big deal. Better to get the language right, than
be 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.
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.
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..."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
endup causing multiple changes instead of just one. Nobody is doing any mission-critical stuff in D yet anyway, so
codeat this phase is not a big deal. Better to get the language right,
tobe backward compatible with an initial concept that turns out not to
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.
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.
Nov 06 2003









"Charles Sanders" <sanders-consulting comcast.net> 