Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework operator interfaces #1178

Merged
merged 10 commits into from
May 3, 2022
Merged

Rework operator interfaces #1178

merged 10 commits into from
May 3, 2022

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Apr 9, 2022

Add concrete design for interfaces for comparison.

Rename interfaces for arithmetic following current thinking in #1058.

Update rules for mixed-type comparisons for data classes following #710.

@zygoloid zygoloid changed the title Add concrete design for interfaces for comparison. Rework operator interfaces Apr 16, 2022
@zygoloid zygoloid marked this pull request as ready for review April 16, 2022 00:58
@zygoloid zygoloid requested review from a team as code owners April 16, 2022 00:58
@zygoloid zygoloid added the proposal A proposal label Apr 16, 2022
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick initial run through based on a prior reading, will do a more thorough read in a bit....

docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
// Widgets are normally ordered by size.
external impl as Ordered {
fn Compare[me: Self](other: Self) -> Ordering {
return me.Size().(Ordered.Compare)(other.Size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not blocking, just a side comment)

FWIW, this makes me more interested in <=> as an operator... I worry this code will be quite common.

docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice! I think I finished a thorough pass now and have left several minor suggestions. I think these are mostly just clarifying things, or tweaking the wording. Nothing really substantial.

docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
docs/design/expressions/comparison_operators.md Outdated Show resolved Hide resolved
proposals/p1178.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the proposal rfc Proposal with request-for-comment sent out label Apr 27, 2022
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ship it!

@zygoloid zygoloid merged commit 3104248 into carbon-language:trunk May 3, 2022
@github-actions github-actions bot added proposal accepted Decision made, proposal accepted and removed proposal rfc Proposal with request-for-comment sent out labels May 3, 2022
chandlerc added a commit that referenced this pull request Jun 28, 2022
Add concrete design for interfaces for comparison.

Rename interfaces for arithmetic following current thinking in #1058.

Update rules for mixed-type comparisons for data classes following #710.

Co-authored-by: Chandler Carruth <[email protected]>
@chandlerc chandlerc added the documentation An issue or proposed change to our documentation label Jan 13, 2023
github-merge-queue bot pushed a commit that referenced this pull request Oct 3, 2023
Continued from part 1: #3231. Second step updating
`docs/design/generics/details.md`. There remains some work to
incorporate proposal #2200.

- The biggest changes are incorporating much of the text of proposals:
  - #2173
  - #2687
- It incorporates changes from proposals:
  - #989
  - #1178
  - #2138
  - #2200
  - #2360
  - #2964
  - #3162
- It also updates the text to reflect the latest thinking from leads
issues:
  - #996
  - #2153 -- most notably deleting the section on `TypeId`.
- Update to rule for prioritization blocks with mixed type structures
from [discussion on
2023-07-18](https://docs.google.com/document/d/1gnJBTfY81fZYvI_QXjwKk1uQHYBNHGqRLI2BS_cYYNQ/edit?resourcekey=0-ql1Q1WvTcDvhycf8LbA9DQ#heading=h.7jxges9ojgy3)
- Adds reference links to proposals, issues, and discussions relevant to
the text.
- Also tries to use more precise language when talking about
implementations, to avoid confusing `impl` declaration and definitions
with the `impls` operator used in `where` clauses, an issue brought up
in
  - #2495 
  - #2483

---------

Co-authored-by: Richard Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation proposal accepted Decision made, proposal accepted proposal A proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants