mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:50:14 +01:00
Update the syntax for class (and interface/`impl`) methods to move `self` into the parameter parentheses `()` and make the type in its binding optional (defaulting to `Self`). Introduce the `static` keyword for non-instance member variables to indicate static storage. Reflects the decision in leads issue [#6931](https://github.com/carbon-language/carbon-lang/issues/6931). Updates the directly relevant design, but leaves a systematic update of examples to a future PR. Assisted-by: Antigravity with Gemini --------- Co-authored-by: Geoff Romer <gromer@google.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Generics
This directory contains the collection of documents describing the generics feature of Carbon:
- Overview - A high-level description of the generics design, with pointers to other design documents that dive deeper into individual topics
- Goals - The motivation and principles guiding the design direction
- Terminology - A glossary establishing common terminology for describing the design
- Detailed design - In-depth description
- Appendix: Coherence - Describes the rationale for Carbon's choice to have coherent generics, and the alternatives.
- Appendix: Rewrite constraints - Describes the detailed rules governing rewrite constraints, and why resolving them terminates.
- Appendix: Witness tables - Describes an implementation strategy for checked generics, and Carbon's rationale for only using it for dynamic dispatch.