|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2011] New: opStar should be called opDeref
http://d.puremagic.com/issues/show_bug.cgi?id=2011 Summary: opStar should be called opDeref Product: D Version: 2.012 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: wbaxter gmail.com Over a year ago when I suggested that operators in D should be written more like op(+) because it's too hard to remember all those operator names (opCom anyone?) Walter told me that opAdd is opAdd because if you're going to overload "+" it better be for the purpose of implementing addition. Hence the name is opAdd, not op(+) or opPlus. So now why do we have opStar? Does the fact that it's named after the operator rather than the operation mean that it's ok to abuse it for whatever purpose you like, unlike "+","/", etc.? Additionally the naming is ambiguious since "*" is also used for multiplication. Since unary "*" dereferences a variable, the name of the method should be opDeref. (We don't say opDivide or opMultipy, so the use of abbreviation is consistent). This has been debated on the NG before and I don't recall any opposition to the suggestion that opStar is the wrong name. I can't find the relevant newsgroup threads now, but if someone can, please add them. -- Apr 18 2008
|