D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2011 - opStar should be called opDeref
Summary: opStar should be called opDeref
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-18 19:49 UTC by Bill Baxter
Modified: 2015-06-09 01:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bill Baxter 2008-04-18 19:49:45 UTC
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.
Comment 1 Don 2010-02-12 00:18:45 UTC
This is obsolete now with the new operator overloading scheme. It's now
opUnary!("*"), and will never be opDeref.