-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Keyword to use in place of is
in where
...is
constraints
#2495
Comments
Another possibility would be to use the same syntax that we use in an interface or named constraint:
This approach would also give syntax for something that's hard to write at the moment:
However, |
I want to directly address this, because I think this is in conflict with Carbon's "Code that is easy to read, understand, and write" goal. We're going to have a lot of non-native, even non-fluent English speakers using Carbon. I find myself having trouble, on a re-reading, understanding whether "Parameterized impls" means "Parameterized Rewriting the documentation to be more specific, replacing all uses of "impls" with either " I want to be clear here, my concern is very much about non-code contexts. In source code, (edit: maybe more the ecosystem goal, given that's the only mention of documentation?) |
Whatever we decide here, I think we should be consistent with |
This came up while discussing #995 and @mconst and I brainstormed some ideas. First, @mconst also found Things we considered:
Lots of these were "fine" but I don't think any really sparked much joy. Some specific concerns I remember coming up...
The form that I find myself coming back to and liking more is Advantages of
Disadvantages:
Overall, I'm not sure the disadvantages outweigh the advantages, and I'm somewhat leaning towards |
@chandlerc and I chatted about this a bit more on Discord. Here's a quick summary -- hopefully this accurately represents your opinion! Neither of us are thrilled with how My preference is As for other options, we both think |
@josh11b, @chandlerc, and I discussed this further today, considering a variety of options: After weighing up all of these options, we are leaning towards |
Sounds good! For what it's worth, as one of the people who found (Another data point: in Rust it's very common to use |
Adding a bit more of the rationale from the discussion:
FWIW, if we had another spelling that didn't have the above two problems, I think we'd be delighted to not bump into the confusion problems of having both |
Marking this as decided -- none of the leads are delighted here, but we're all ending up in the same point in the tradeoff space so let's ship it. |
Includes proposals: - #990 - #2188 - #2138 - #2200 - #2360 - #2760 - #2964 - #3162 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 and #2483; - "binding patterns", like `x: i32`, and "bindings" like `x`. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
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 <richard@metafoo.co.uk>
Summary of issue:
A question arose in proposal #2483 about what keyword should be used to replace
is
. The particular syntax in question is when expressing a constraint that a type variable implements an interface or satisfies a named constraint, for examplewhere .ElementType is Ordered
. (It should be noted that this case is not expected to be particularly frequent.)Proposal #2483 suggests replacing
is
withimpls
, but @jonmeow raised concerns that would be ambiguous with the plural ofimpl
. My take is that there is a relationship between these two words that I want to preserve, that animpls
constraint can be satisfied by writing animpl
declaration, and in the examples I've looked at I had no problem disambiguating. I expect this is because this ambiguity commonly arises in English for words (like "pile") that can be used as both nouns and verbs, and so I have a lot of practice disambiguating.I've also raised this question in the #naming channel on Discord.
The text was updated successfully, but these errors were encountered: