https://issues.dlang.org/show_bug.cgi?id=18998

          Issue ID: 18998
           Summary: Improve Operator Overloading docs
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dlang.org
          Assignee: nob...@puremagic.com
          Reporter: turkey...@gmail.com

The language Operator Overloading document has devolved into chaos!

Picture that you don't know D, and you want to learn about operator
overloading, and now read that document.

Press Ctrl-F and type "opSlice", scroll the highlighted text, try and
understand how to implement a slicing operator properly. Note that the first
contact you see looks like this:
  `-a[i..j]    a.opIndexUnary!("-")(a.opSlice(i, j))`  wat?!

I think this document needs a complete overhaul, starting with a list of
special operators that exist, description of each special operator and example
of how they work in **the most simple case**, and show complex compounds and
aggregate rewrites towards the end, only after the basic meaning of all
operators has been established.

This is a critical language document, and it's not terribly helpful to new
users.

--

Reply via email to