From 94d2c1c6d45935105d39d284711b0c7a77227ad2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 28 May 2026 17:55:04 -0700 Subject: [PATCH] Make proposal filenames use 6 digits and include the title (#7245) We've talked about adding the title to the filename several times over the years and it seems really valuable. This requires us to compute a "slug" for the title spelling that can be part of the filename. Beyond that, we crossed 7000 recently, and so it seems likely that we will need to add digits sooner rather than later here, so this goes ahead and moves us to 6 digits so we don't have to adjust again for a reasonable length of time. To implement this and ensure we can sustain it going forward this adds a tool to our pre-commit that validates (and corrects if needed) the filename. In order to update everything and keep links working, there are a _lot_ of changes, but the most interesting for direct review are in `proposals/scripts`. Assisted-by: Antigravity with Gemini --------- Co-authored-by: Richard Smith --- .pre-commit-config.yaml | 11 ++ docs/design/README.md | 6 +- docs/design/assignment.md | 16 +- docs/design/classes.md | 154 ++++++++-------- .../code_and_name_organization/README.md | 98 +++++------ .../source_files.md | 6 +- docs/design/control_flow/conditionals.md | 6 +- docs/design/control_flow/loops.md | 14 +- docs/design/control_flow/return.md | 8 +- docs/design/declaring_entities.md | 44 ++--- docs/design/expressions/README.md | 6 +- docs/design/expressions/arithmetic.md | 30 ++-- docs/design/expressions/as_expressions.md | 10 +- docs/design/expressions/bitwise.md | 10 +- .../expressions/comparison_operators.md | 16 +- docs/design/expressions/if.md | 16 +- .../expressions/implicit_conversions.md | 10 +- docs/design/expressions/indexing.md | 10 +- docs/design/expressions/literals.md | 16 +- docs/design/expressions/logical_operators.md | 14 +- docs/design/expressions/member_access.md | 17 +- docs/design/expressions/pointer_operators.md | 4 +- docs/design/expressions/type_operators.md | 8 +- docs/design/functions.md | 12 +- docs/design/generics/details.md | 111 ++++++------ docs/design/lambdas.md | 8 +- docs/design/lexical_conventions/comments.md | 10 +- .../lexical_conventions/numeric_literals.md | 22 +-- .../lexical_conventions/string_literals.md | 22 +-- .../lexical_conventions/symbolic_tokens.md | 2 +- docs/design/lexical_conventions/whitespace.md | 2 +- docs/design/lexical_conventions/words.md | 22 +-- docs/design/naming_conventions.md | 4 +- docs/design/pattern_matching.md | 50 +++--- docs/design/sum_types.md | 12 +- docs/design/tuples.md | 8 +- docs/design/type_inference.md | 2 +- docs/design/values.md | 73 ++++---- docs/design/variadics.md | 38 ++-- docs/project/design_style_guide.md | 4 +- docs/project/evolution.md | 11 +- docs/project/faq.md | 9 +- .../principles/information_accumulation.md | 11 +- docs/project/principles/library_apis_only.md | 2 +- .../principles/low_context_sensitivity.md | 4 +- .../principles/namespace_cleanliness.md | 4 +- docs/project/principles/one_way.md | 11 +- docs/project/versioning.md | 2 +- proposals/README.md | 11 +- .../{p0024.md => p000024-generics-goals.md} | 0 ...ebase-and-pull-request-github-workflow.md} | 0 ... p000042-create-code-review-guidelines.md} | 0 ...{p0044.md => p000044-proposal-tracking.md} | 0 proposals/{p0051.md => p000051-goals.md} | 0 ...00063-criteria-for-carbon-to-go-public.md} | 0 ...decision-timelines-in-proposal-process.md} | 0 ...=> p000083-in-progress-design-overview.md} | 0 ... => p000107-code-and-name-organization.md} | 0 ...0113.md => p000113-add-a-c-style-guide.md} | 0 ...nce-and-developer-facing-docs-to-goals.md} | 0 ...tial-rough-framework-for-specification.md} | 0 ...142.md => p000142-unicode-source-files.md} | 0 .../{p0143.md => p000143-numeric-literals.md} | 0 ...d => p000144-numeric-literal-semantics.md} | 0 ...00149-change-documentation-style-guide.md} | 0 ...p000157-design-direction-for-sum-types.md} | 7 +- .../{p0162.md => p000162-basic-syntax.md} | 10 +- ...md => p000175-c-interoperability-goals.md} | 0 ....md => p000179-create-a-toolchain-team.md} | 0 ...p000196-language-level-safety-strategy.md} | 0 proposals/{p0198.md => p000198-comments.md} | 0 .../{p0199.md => p000199-string-literals.md} | 0 .../{p0253.md => p000253-2021-roadmap.md} | 0 ...initialization-of-memory-and-variables.md} | 0 proposals/{p0285.md => p000285-if-else.md} | 0 ...=> p000301-principle-errors-are-values.md} | 0 .../{p0339.md => p000339-var-statement.md} | 4 +- .../{p0340.md => p000340-while-loops.md} | 0 proposals/{p0353.md => p000353-for-loops.md} | 0 .../{p0415.md => p000415-syntax-return.md} | 0 ...=> p000426-governance-evolution-revamp.md} | 0 proposals/{p0438.md => p000438-functions.md} | 0 ...p0444.md => p000444-github-discussions.md} | 0 ...447.md => p000447-generics-terminology.md} | 0 ...{p0524.md => p000524-generics-overview.md} | 0 ....md => p000538-return-with-no-argument.md} | 0 .../{p0540.md => p000540-remove-void.md} | 0 ....md => p000553-generics-details-part-1.md} | 0 ...0555.md => p000555-operator-precedence.md} | 8 +- .../example.svg | 0 .../figures.py | 0 .../yacc-parser/Makefile | 0 .../yacc-parser/example.l | 0 .../yacc-parser/example.y | 0 ...-literals-struct-types-and-future-work.md} | 0 .../{p0601.md => p000601-operator-tokens.md} | 0 .../{p0618.md => p000618-var-ordering.md} | 0 .../{p0623.md => p000623-require-braces.md} | 5 +- ...0646-low-context-sensitivity-principle.md} | 0 .../{p0676.md => p000676-generic-syntax.md} | 0 proposals/{p0680.md => p000680-and-or-not.md} | 4 +- ...702.md => p000702-comparison-operators.md} | 0 ...720.md => p000720-property-naming-in-c.md} | 0 ...=> p000722-nominal-classes-and-methods.md} | 0 ...ociated-types-parameterized-interfaces.md} | 2 +- ....md => p000752-api-file-default-public.md} | 0 .../{p0777.md => p000777-inheritance.md} | 0 ...raints-for-generics-generics-details-3.md} | 8 +- .../regular_equivalence_classes.md | 0 ...820.md => p000820-implicit-conversions.md} | 0 ...p000826-function-return-type-inference.md} | 8 +- ...{p0829.md => p000829-one-way-principle.md} | 0 .../{p0845.md => p000845-as-expressions.md} | 0 ....md => p000851-variable-type-inference.md} | 11 +- ...p0861.md => p000861-naming-conventions.md} | 0 ...000866-allow-ties-in-floating-literals.md} | 8 +- ...875-principle-information-accumulation.md} | 0 ....md => p000911-conditional-expressions.md} | 0 ...000920-generic-blanket-impls-details-5.md} | 3 +- ...p000931-generic-impls-access-details-4.md} | 0 ...00950-generics-details-6-remove-facets.md} | 0 ...81-implicit-conversions-for-aggregates.md} | 0 ...p000983-generics-details-7-final-impls.md} | 0 ...d => p000989-member-access-expressions.md} | 0 ...-8-interface-default-and-final-members.md} | 0 ...le-one-static-open-extension-mechanism.md} | 0 ...ated-constants-using-where-constraints.md} | 0 .../{p1025.md => p001025-roadmap-for-2022.md} | 0 ...3.md => p001083-arithmetic-expressions.md} | 4 +- ...enerics-details-9-forward-declarations.md} | 0 ...-10-interface-implemented-requirements.md} | 0 ...eneric-details-11-operator-overloading.md} | 2 +- ...generic-details-12-parameterized-types.md} | 0 .../{p1154.md => p001154-destructors.md} | 4 +- ... => p001178-rework-operator-interfaces.md} | 0 ...1190.md => p001190-reviewer-merged-prs.md} | 0 ...=> p001191-bitwise-and-shift-operators.md} | 0 ...adme-content-and-motivation-for-carbon.md} | 0 ...80-principle-all-apis-are-library-apis.md} | 0 ...327.md => p001327-generics-impl-forall.md} | 0 ...om-the-repository-and-clean-up-history.md} | 0 ...ine-string-and-represents-block-string.md} | 0 ...1363-make-the-carbon-experiment-public.md} | 0 ...{p1367.md => p001367-remove-codeowners.md} | 0 .../{p1382.md => p001382-rename-me-self.md} | 0 ...> p001885-for-statement-and-user-types.md} | 2 +- ...1891.md => p001891-are-we-explorer-yet.md} | 0 ...p1964.md => p001964-character-literals.md} | 10 +- ...weaken-digit-separator-placement-rules.md} | 24 +-- ...lues-variables-pointers-and-references.md} | 4 +- ...=> p002015-numeric-type-literal-syntax.md} | 0 ...rn-bindings-unused-function-parameters.md} | 0 ... => p002040-unicode-escape-code-length.md} | 0 ...107-clarify-rules-around-self-and-self.md} | 0 ...ecked-and-template-generic-terminology.md} | 0 ...ed-constant-assignment-versus-equality.md} | 0 ....md => p002187-update-sum-types-design.md} | 3 +- ...-pattern-matching-syntax-and-semantics.md} | 19 +- ...{p2200.md => p002200-template-generics.md} | 0 proposals/{p2240.md => p002240-variadics.md} | 0 ...p002274-subscript-syntax-and-semantics.md} | 0 ... p002287-allow-unqualified-name-lookup.md} | 0 ...oc-and-moderation-transparency-reports.md} | 0 ...n-be-done-with-an-incomplete-interface.md} | 4 +- ... p002360-types-are-values-of-type-type.md} | 4 +- ...rtificial-version-ceiling-on-c-interop.md} | 0 ...d => p002376-constraints-must-use-self.md} | 0 ... p002483-replace-keyword-is-with-impls.md} | 0 ...11.md => p002511-assignment-statements.md} | 0 ...ckage-declaration-for-the-main-package.md} | 2 +- ...ap-for-2023-and-retrospective-for-2022.md} | 0 ...002665-semicolons-terminate-statements.md} | 0 ...rmination-algorithm-for-impl-selection.md} | 0 ...d => p002759-defining-the-0-1-language.md} | 0 ...-consistent-class-and-interface-syntax.md} | 0 ...overlap-with-a-final-impl-if-identical.md} | 2 +- ...ions-function-types-and-function-calls.md} | 0 ...> p002922-introduce-a-new-conduct-team.md} | 0 ...> p002964-expression-phase-terminology.md} | 0 ...003162-reduce-ambiguity-in-terminology.md} | 12 +- ...403-change-main-default-to-an-api-file.md} | 0 ...07-clarify-name-bindings-in-namespaces.md} | 0 ...implementation-effort-on-the-toolchain.md} | 0 ...-for-2024-and-a-retrospective-for-2023.md} | 3 +- ...d => p003646-tuples-and-tuple-indexing.md} | 0 ...md => p003720-member-binding-operators.md} | 6 +- ...> p003762-merging-forward-declarations.md} | 0 ....md => p003763-matching-redeclarations.md} | 3 +- ...97.md => p003797-raw-identifier-syntax.md} | 0 ...ty-when-representing-rewrite-semantics.md} | 0 proposals/{p3848.md => p003848-lambdas.md} | 0 ...p003927-more-consistent-package-syntax.md} | 9 +- ...md => p003938-exporting-imported-names.md} | 0 ...> p003980-singular-extern-declarations.md} | 0 ... => p004075-change-operator-precedence.md} | 0 ...lish-toolchain-and-language-versioning.md} | 0 ...46.md => p004246-getting-commit-access.md} | 0 ...direct-storage-immutably-sized-buffers.md} | 6 +- ...declared-identifiers-core-is-a-keyword.md} | 0 ...0-safety-milestones-and-a-2025-roadmap.md} | 0 ...{p5017.md => p005017-destructor-syntax.md} | 2 +- ...lified-lookup-into-types-being-defined.md} | 2 +- ...pdates-to-pattern-matching-for-objects.md} | 0 ...declaration-of-an-incomplete-interface.md} | 2 +- ...=> p005233-towards-more-async-sync-ing.md} | 0 ...plorer-out-of-toolchain-git-repository.md} | 5 +- ...erface-extension-and-final-impl-update.md} | 7 +- ...366-the-name-of-an-impl-in-class-scope.md} | 9 +- ...ters-arguments-returns-and-val-returns.md} | 4 +- ...05448-carbon-c-interop-primitive-types.md} | 86 ++++----- ...5.md => p005545-expression-form-basics.md} | 0 ... p005606-keep-design-documents-current.md} | 10 +- ...05661-progressive-disclosure-principle.md} | 0 ...=> p005670-guidance-on-ai-coding-tools.md} | 0 ...ent-resolution-for-rewrite-constraints.md} | 0 ...5914-updating-carbon-s-safety-strategy.md} | 0 ...06008-replace-impl-fn-with-override-fn.md} | 0 ...op-mapping-std-string-view-to-core-str.md} | 0 ... => p006231-disambiguate-value-binding.md} | 0 ...hain-implementation-for-function-calls.md} | 4 +- ...> p006333-cli-and-separate-compilation.md} | 0 ...006357-c-interop-mapping-pointer-types.md} | 0 ...-c-interop-api-importing-and-semantics.md} | 0 ...=> p006395-type-completeness-in-extend.md} | 8 +- ...41.md => p006641-clang-irgen-in-carbon.md} | 0 ...or-integer-and-floating-point-literals.md} | 10 +- ...terop-importing-c-c-object-like-macros.md} | 2 +- ...p6699.md => p006699-diagnostic-sorting.md} | 0 .../{p6710.md => p006710-char-redesign.md} | 0 ...ve-toolchain-alternatives-to-proposals.md} | 0 ...f-a-named-constraint-during-definition.md} | 17 +- ...0.md => p006910-support-octal-literals.md} | 6 +- ...tax-and-adding-static-member-variables.md} | 3 +- proposals/scripts/BUILD | 31 +++- proposals/scripts/check_proposal_names.py | 166 ++++++++++++++++++ .../scripts/check_proposal_names_test.py | 149 ++++++++++++++++ proposals/scripts/new_proposal.py | 8 +- proposals/scripts/utils.py | 16 ++ proposals/scripts/utils_test.py | 35 ++++ toolchain/check/cpp/import.cpp | 2 +- toolchain/check/merge.cpp | 2 +- .../check/testdata/impl/redeclaration.carbon | 8 +- toolchain/docs/check/README.md | 2 +- toolchain/docs/coalesce_generic_lowering.md | 10 +- toolchain/docs/design/clang_api.md | 6 +- toolchain/docs/diagnostics.md | 6 +- toolchain/docs/lex.md | 2 +- toolchain/docs/parse.md | 2 +- utils/tree_sitter/grammar.js | 2 +- website/prebuild.py | 2 +- 250 files changed, 1139 insertions(+), 685 deletions(-) rename proposals/{p0024.md => p000024-generics-goals.md} (100%) rename proposals/{p0029.md => p000029-linear-rebase-and-pull-request-github-workflow.md} (100%) rename proposals/{p0042.md => p000042-create-code-review-guidelines.md} (100%) rename proposals/{p0044.md => p000044-proposal-tracking.md} (100%) rename proposals/{p0051.md => p000051-goals.md} (100%) rename proposals/{p0063.md => p000063-criteria-for-carbon-to-go-public.md} (100%) rename proposals/{p0074.md => p000074-change-comment-decision-timelines-in-proposal-process.md} (100%) rename proposals/{p0083.md => p000083-in-progress-design-overview.md} (100%) rename proposals/{p0107.md => p000107-code-and-name-organization.md} (100%) rename proposals/{p0113.md => p000113-add-a-c-style-guide.md} (100%) rename proposals/{p0120.md => p000120-add-idiomatic-code-performance-and-developer-facing-docs-to-goals.md} (100%) rename proposals/{p0140.md => p000140-create-initial-rough-framework-for-specification.md} (100%) rename proposals/{p0142.md => p000142-unicode-source-files.md} (100%) rename proposals/{p0143.md => p000143-numeric-literals.md} (100%) rename proposals/{p0144.md => p000144-numeric-literal-semantics.md} (100%) rename proposals/{p0149.md => p000149-change-documentation-style-guide.md} (100%) rename proposals/{p0157.md => p000157-design-direction-for-sum-types.md} (99%) rename proposals/{p0162.md => p000162-basic-syntax.md} (98%) rename proposals/{p0175.md => p000175-c-interoperability-goals.md} (100%) rename proposals/{p0179.md => p000179-create-a-toolchain-team.md} (100%) rename proposals/{p0196.md => p000196-language-level-safety-strategy.md} (100%) rename proposals/{p0198.md => p000198-comments.md} (100%) rename proposals/{p0199.md => p000199-string-literals.md} (100%) rename proposals/{p0253.md => p000253-2021-roadmap.md} (100%) rename proposals/{p0257.md => p000257-initialization-of-memory-and-variables.md} (100%) rename proposals/{p0285.md => p000285-if-else.md} (100%) rename proposals/{p0301.md => p000301-principle-errors-are-values.md} (100%) rename proposals/{p0339.md => p000339-var-statement.md} (99%) rename proposals/{p0340.md => p000340-while-loops.md} (100%) rename proposals/{p0353.md => p000353-for-loops.md} (100%) rename proposals/{p0415.md => p000415-syntax-return.md} (100%) rename proposals/{p0426.md => p000426-governance-evolution-revamp.md} (100%) rename proposals/{p0438.md => p000438-functions.md} (100%) rename proposals/{p0444.md => p000444-github-discussions.md} (100%) rename proposals/{p0447.md => p000447-generics-terminology.md} (100%) rename proposals/{p0524.md => p000524-generics-overview.md} (100%) rename proposals/{p0538.md => p000538-return-with-no-argument.md} (100%) rename proposals/{p0540.md => p000540-remove-void.md} (100%) rename proposals/{p0553.md => p000553-generics-details-part-1.md} (100%) rename proposals/{p0555.md => p000555-operator-precedence.md} (98%) rename proposals/{p0555 => p000555-operator-precedence}/example.svg (100%) rename proposals/{p0555 => p000555-operator-precedence}/figures.py (100%) rename proposals/{p0555 => p000555-operator-precedence}/yacc-parser/Makefile (100%) rename proposals/{p0555 => p000555-operator-precedence}/yacc-parser/example.l (100%) rename proposals/{p0555 => p000555-operator-precedence}/yacc-parser/example.y (100%) rename proposals/{p0561.md => p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md} (100%) rename proposals/{p0601.md => p000601-operator-tokens.md} (100%) rename proposals/{p0618.md => p000618-var-ordering.md} (100%) rename proposals/{p0623.md => p000623-require-braces.md} (97%) rename proposals/{p0646.md => p000646-low-context-sensitivity-principle.md} (100%) rename proposals/{p0676.md => p000676-generic-syntax.md} (100%) rename proposals/{p0680.md => p000680-and-or-not.md} (98%) rename proposals/{p0702.md => p000702-comparison-operators.md} (100%) rename proposals/{p0720.md => p000720-property-naming-in-c.md} (100%) rename proposals/{p0722.md => p000722-nominal-classes-and-methods.md} (100%) rename proposals/{p0731.md => p000731-generics-details-2-adapters-associated-types-parameterized-interfaces.md} (99%) rename proposals/{p0752.md => p000752-api-file-default-public.md} (100%) rename proposals/{p0777.md => p000777-inheritance.md} (100%) rename proposals/{p0818.md => p000818-constraints-for-generics-generics-details-3.md} (98%) rename proposals/{p0818 => p000818-constraints-for-generics-generics-details-3}/regular_equivalence_classes.md (100%) rename proposals/{p0820.md => p000820-implicit-conversions.md} (100%) rename proposals/{p0826.md => p000826-function-return-type-inference.md} (97%) rename proposals/{p0829.md => p000829-one-way-principle.md} (100%) rename proposals/{p0845.md => p000845-as-expressions.md} (100%) rename proposals/{p0851.md => p000851-variable-type-inference.md} (96%) rename proposals/{p0861.md => p000861-naming-conventions.md} (100%) rename proposals/{p0866.md => p000866-allow-ties-in-floating-literals.md} (93%) rename proposals/{p0875.md => p000875-principle-information-accumulation.md} (100%) rename proposals/{p0911.md => p000911-conditional-expressions.md} (100%) rename proposals/{p0920.md => p000920-generic-blanket-impls-details-5.md} (99%) rename proposals/{p0931.md => p000931-generic-impls-access-details-4.md} (100%) rename proposals/{p0950.md => p000950-generics-details-6-remove-facets.md} (100%) rename proposals/{p0981.md => p000981-implicit-conversions-for-aggregates.md} (100%) rename proposals/{p0983.md => p000983-generics-details-7-final-impls.md} (100%) rename proposals/{p0989.md => p000989-member-access-expressions.md} (100%) rename proposals/{p0990.md => p000990-generics-details-8-interface-default-and-final-members.md} (100%) rename proposals/{p0998.md => p000998-principle-one-static-open-extension-mechanism.md} (100%) rename proposals/{p1013.md => p001013-generics-set-associated-constants-using-where-constraints.md} (100%) rename proposals/{p1025.md => p001025-roadmap-for-2022.md} (100%) rename proposals/{p1083.md => p001083-arithmetic-expressions.md} (99%) rename proposals/{p1084.md => p001084-generics-details-9-forward-declarations.md} (100%) rename proposals/{p1088.md => p001088-generic-details-10-interface-implemented-requirements.md} (100%) rename proposals/{p1144.md => p001144-generic-details-11-operator-overloading.md} (98%) rename proposals/{p1146.md => p001146-generic-details-12-parameterized-types.md} (100%) rename proposals/{p1154.md => p001154-destructors.md} (98%) rename proposals/{p1178.md => p001178-rework-operator-interfaces.md} (100%) rename proposals/{p1190.md => p001190-reviewer-merged-prs.md} (100%) rename proposals/{p1191.md => p001191-bitwise-and-shift-operators.md} (100%) rename proposals/{p1270.md => p001270-update-and-expand-readme-content-and-motivation-for-carbon.md} (100%) rename proposals/{p1280.md => p001280-principle-all-apis-are-library-apis.md} (100%) rename proposals/{p1327.md => p001327-generics-impl-forall.md} (100%) rename proposals/{p1344.md => p001344-remove-llvm-from-the-repository-and-clean-up-history.md} (100%) rename proposals/{p1360.md => p001360-change-raw-string-literal-syntax-represents-single-line-string-and-represents-block-string.md} (100%) rename proposals/{p1363.md => p001363-make-the-carbon-experiment-public.md} (100%) rename proposals/{p1367.md => p001367-remove-codeowners.md} (100%) rename proposals/{p1382.md => p001382-rename-me-self.md} (100%) rename proposals/{p1885.md => p001885-for-statement-and-user-types.md} (99%) rename proposals/{p1891.md => p001891-are-we-explorer-yet.md} (100%) rename proposals/{p1964.md => p001964-character-literals.md} (97%) rename proposals/{p1983.md => p001983-weaken-digit-separator-placement-rules.md} (89%) rename proposals/{p2006.md => p002006-values-variables-pointers-and-references.md} (99%) rename proposals/{p2015.md => p002015-numeric-type-literal-syntax.md} (100%) rename proposals/{p2022.md => p002022-unused-pattern-bindings-unused-function-parameters.md} (100%) rename proposals/{p2040.md => p002040-unicode-escape-code-length.md} (100%) rename proposals/{p2107.md => p002107-clarify-rules-around-self-and-self.md} (100%) rename proposals/{p2138.md => p002138-checked-and-template-generic-terminology.md} (100%) rename proposals/{p2173.md => p002173-associated-constant-assignment-versus-equality.md} (100%) rename proposals/{p2187.md => p002187-update-sum-types-design.md} (96%) rename proposals/{p2188.md => p002188-pattern-matching-syntax-and-semantics.md} (98%) rename proposals/{p2200.md => p002200-template-generics.md} (100%) rename proposals/{p2240.md => p002240-variadics.md} (100%) rename proposals/{p2274.md => p002274-subscript-syntax-and-semantics.md} (100%) rename proposals/{p2287.md => p002287-allow-unqualified-name-lookup.md} (100%) rename proposals/{p2295.md => p002295-begin-publishing-coc-and-moderation-transparency-reports.md} (100%) rename proposals/{p2347.md => p002347-what-can-be-done-with-an-incomplete-interface.md} (96%) rename proposals/{p2360.md => p002360-types-are-values-of-type-type.md} (99%) rename proposals/{p2365.md => p002365-remove-artificial-version-ceiling-on-c-interop.md} (100%) rename proposals/{p2376.md => p002376-constraints-must-use-self.md} (100%) rename proposals/{p2483.md => p002483-replace-keyword-is-with-impls.md} (100%) rename proposals/{p2511.md => p002511-assignment-statements.md} (100%) rename proposals/{p2550.md => p002550-simplified-package-declaration-for-the-main-package.md} (99%) rename proposals/{p2551.md => p002551-roadmap-for-2023-and-retrospective-for-2022.md} (100%) rename proposals/{p2665.md => p002665-semicolons-terminate-statements.md} (100%) rename proposals/{p2687.md => p002687-termination-algorithm-for-impl-selection.md} (100%) rename proposals/{p2759.md => p002759-defining-the-0-1-language.md} (100%) rename proposals/{p2760.md => p002760-consistent-class-and-interface-syntax.md} (100%) rename proposals/{p2868.md => p002868-allow-overlap-with-a-final-impl-if-identical.md} (98%) rename proposals/{p2875.md => p002875-functions-function-types-and-function-calls.md} (100%) rename proposals/{p2922.md => p002922-introduce-a-new-conduct-team.md} (100%) rename proposals/{p2964.md => p002964-expression-phase-terminology.md} (100%) rename proposals/{p3162.md => p003162-reduce-ambiguity-in-terminology.md} (94%) rename proposals/{p3403.md => p003403-change-main-default-to-an-api-file.md} (100%) rename proposals/{p3407.md => p003407-clarify-name-bindings-in-namespaces.md} (100%) rename proposals/{p3532.md => p003532-focus-implementation-effort-on-the-toolchain.md} (100%) rename proposals/{p3564.md => p003564-roadmap-for-2024-and-a-retrospective-for-2023.md} (98%) rename proposals/{p3646.md => p003646-tuples-and-tuple-indexing.md} (100%) rename proposals/{p3720.md => p003720-member-binding-operators.md} (99%) rename proposals/{p3762.md => p003762-merging-forward-declarations.md} (100%) rename proposals/{p3763.md => p003763-matching-redeclarations.md} (99%) rename proposals/{p3797.md => p003797-raw-identifier-syntax.md} (100%) rename proposals/{p3833.md => p003833-semir-fidelity-when-representing-rewrite-semantics.md} (100%) rename proposals/{p3848.md => p003848-lambdas.md} (100%) rename proposals/{p3927.md => p003927-more-consistent-package-syntax.md} (94%) rename proposals/{p3938.md => p003938-exporting-imported-names.md} (100%) rename proposals/{p3980.md => p003980-singular-extern-declarations.md} (100%) rename proposals/{p4075.md => p004075-change-operator-precedence.md} (100%) rename proposals/{p4105.md => p004105-establish-toolchain-and-language-versioning.md} (100%) rename proposals/{p4246.md => p004246-getting-commit-access.md} (100%) rename proposals/{p4682.md => p004682-the-core-array-type-for-direct-storage-immutably-sized-buffers.md} (98%) rename proposals/{p4864.md => p004864-no-predeclared-identifiers-core-is-a-keyword.md} (100%) rename proposals/{p4880.md => p004880-safety-milestones-and-a-2025-roadmap.md} (100%) rename proposals/{p5017.md => p005017-destructor-syntax.md} (98%) rename proposals/{p5087.md => p005087-qualified-lookup-into-types-being-defined.md} (99%) rename proposals/{p5164.md => p005164-updates-to-pattern-matching-for-objects.md} (100%) rename proposals/{p5168.md => p005168-forward-impl-declaration-of-an-incomplete-interface.md} (99%) rename proposals/{p5233.md => p005233-towards-more-async-sync-ing.md} (100%) rename proposals/{p5270.md => p005270-move-explorer-out-of-toolchain-git-repository.md} (96%) rename proposals/{p5337.md => p005337-interface-extension-and-final-impl-update.md} (99%) rename proposals/{p5366.md => p005366-the-name-of-an-impl-in-class-scope.md} (96%) rename proposals/{p5434.md => p005434-ref-parameters-arguments-returns-and-val-returns.md} (99%) rename proposals/{p5448.md => p005448-carbon-c-interop-primitive-types.md} (83%) rename proposals/{p5545.md => p005545-expression-form-basics.md} (100%) rename proposals/{p5606.md => p005606-keep-design-documents-current.md} (96%) rename proposals/{p5661.md => p005661-progressive-disclosure-principle.md} (100%) rename proposals/{p5670.md => p005670-guidance-on-ai-coding-tools.md} (100%) rename proposals/{p5689.md => p005689-semantic-identity-and-order-dependent-resolution-for-rewrite-constraints.md} (100%) rename proposals/{p5914.md => p005914-updating-carbon-s-safety-strategy.md} (100%) rename proposals/{p6008.md => p006008-replace-impl-fn-with-override-fn.md} (100%) rename proposals/{p6177.md => p006177-c-interop-mapping-std-string-view-to-core-str.md} (100%) rename proposals/{p6231.md => p006231-disambiguate-value-binding.md} (100%) rename proposals/{p6254.md => p006254-c-interop-toolchain-implementation-for-function-calls.md} (98%) rename proposals/{p6333.md => p006333-cli-and-separate-compilation.md} (100%) rename proposals/{p6357.md => p006357-c-interop-mapping-pointer-types.md} (100%) rename proposals/{p6358.md => p006358-c-interop-api-importing-and-semantics.md} (100%) rename proposals/{p6395.md => p006395-type-completeness-in-extend.md} (96%) rename proposals/{p6641.md => p006641-clang-irgen-in-carbon.md} (100%) rename proposals/{p6668.md => p006668-c-interop-type-mapping-for-integer-and-floating-point-literals.md} (97%) rename proposals/{p6676.md => p006676-carbon-c-interop-importing-c-c-object-like-macros.md} (99%) rename proposals/{p6699.md => p006699-diagnostic-sorting.md} (100%) rename proposals/{p6710.md => p006710-char-redesign.md} (100%) rename proposals/{p6716.md => p006716-move-toolchain-alternatives-to-proposals.md} (100%) rename proposals/{p6902.md => p006902-identification-of-a-named-constraint-during-definition.md} (94%) rename proposals/{p6910.md => p006910-support-octal-literals.md} (95%) rename proposals/{p7016.md => p007016-updating-self-syntax-and-adding-static-member-variables.md} (99%) create mode 100755 proposals/scripts/check_proposal_names.py create mode 100644 proposals/scripts/check_proposal_names_test.py create mode 100644 proposals/scripts/utils.py create mode 100644 proposals/scripts/utils_test.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65a748d9e2df..54fad7ac5988 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -112,6 +112,17 @@ repos: entry: scripts/check_sha_filenames.py language: python files: ^.*/fuzzer_corpus/.*$ + - id: check-proposal-names + name: Check proposal names + entry: proposals/scripts/check_proposal_names.py + language: python + files: ^proposals/p.*\.md$ + # This edits files other than the ones passed to it, so we need each + # chunk of files to be run through the script serially. + require_serial: true + # This also renames files, invalidating the list of files provided to + # subsequent checks so we fail-fast if this makes changes. + fail_fast: true - id: check-toolchain-diagnostics name: Check toolchain diagnostics entry: toolchain/diagnostics/check_diagnostics.py diff --git a/docs/design/README.md b/docs/design/README.md index 7b0109325b51..f821da3ccede 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -486,7 +486,7 @@ intended for bit manipulation or modular arithmetic as often found in [PRNG](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) use cases. Values which can never be negative, like sizes, but for which wrapping does not make sense -[should use signed integer types](/proposals/p1083.md#dont-let-unsigned-arithmetic-wrap). +[should use signed integer types](/proposals/p001083-arithmetic-expressions.md#dont-let-unsigned-arithmetic-wrap). Identifiers of the form `iN` and `uN` are _type literals_, resulting in the corresponding type. @@ -864,7 +864,7 @@ or restrictions on casts between pointers and integers. ### Arrays and slices > **TODO:** The provisional array syntax documented here has been superseded by -> [p4682: The Core.Array type for direct-storage immutably-sized buffers](/proposals/p4682.md). +> [#4682: The Core.Array type for direct-storage immutably-sized buffers](/proposals/p004682-the-core-array-type-for-direct-storage-immutably-sized-buffers.md). The type of an array of holding 4 `i32` values is written `[i32; 4]`. There is an [implicit conversion](expressions/implicit_conversions.md) from tuples to @@ -3521,7 +3521,7 @@ ABI compatibility. > References: > > - [Goals: Stable language and library ABI non-goal](https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/goals.md#stable-language-and-library-abi) -> - [#175: C++ interoperability goals: Support mixing Carbon and C++ toolchains](/proposals/p0175.md#support-mixing-carbon-and-c-toolchains) +> - [#175: C++ interoperability goals: Support mixing Carbon and C++ toolchains](/proposals/p000175-c-interoperability-goals.md#support-mixing-carbon-and-c-toolchains) ### Operator overloading diff --git a/docs/design/assignment.md b/docs/design/assignment.md index d725df907171..39605707c710 100644 --- a/docs/design/assignment.md +++ b/docs/design/assignment.md @@ -331,14 +331,14 @@ impl MyString as AddAssignWith(like MyString) { ## Alternatives considered -- [Allow assignment as a subexpression](/proposals/p2511.md#allow-assignment-as-a-subexpression) -- [Allow chained assignment](/proposals/p2511.md#allow-chained-assignment) -- [Do not provide increment and decrement](/proposals/p2511.md#do-not-provide-increment-and-decrement) -- [Treat increment as syntactic sugar for adding `1`](/proposals/p2511.md#treat-increment-as-syntactic-sugar-for-adding-1) -- [Define `$` in terms of `$=`](/proposals/p2511.md#define--in-terms-of-) -- [Do not allow overloading the behavior of `=`](/proposals/p2511.md#do-not-allow-overloading-the-behavior-of-) -- [Treat the left hand side of `=` as a pattern](/proposals/p2511.md#treat-the-left-hand-side-of--as-a-pattern) -- [Different names for interfaces](/proposals/p2511.md#different-names-for-interfaces) +- [Allow assignment as a subexpression](/proposals/p002511-assignment-statements.md#allow-assignment-as-a-subexpression) +- [Allow chained assignment](/proposals/p002511-assignment-statements.md#allow-chained-assignment) +- [Do not provide increment and decrement](/proposals/p002511-assignment-statements.md#do-not-provide-increment-and-decrement) +- [Treat increment as syntactic sugar for adding `1`](/proposals/p002511-assignment-statements.md#treat-increment-as-syntactic-sugar-for-adding-1) +- [Define `$` in terms of `$=`](/proposals/p002511-assignment-statements.md#define--in-terms-of-) +- [Do not allow overloading the behavior of `=`](/proposals/p002511-assignment-statements.md#do-not-allow-overloading-the-behavior-of-) +- [Treat the left hand side of `=` as a pattern](/proposals/p002511-assignment-statements.md#treat-the-left-hand-side-of--as-a-pattern) +- [Different names for interfaces](/proposals/p002511-assignment-statements.md#different-names-for-interfaces) ## References diff --git a/docs/design/classes.md b/docs/design/classes.md index df8c701e70fc..dca747393eeb 100644 --- a/docs/design/classes.md +++ b/docs/design/classes.md @@ -646,7 +646,7 @@ class types when: same field names. For example, since -[comparison between `i32` and `u32` is defined](/proposals/p0702.md#built-in-comparisons-and-implicit-conversions), +[comparison between `i32` and `u32` is defined](/proposals/p000702-comparison-operators.md#built-in-comparisons-and-implicit-conversions), equality comparison between values of types `{.x: i32, .y: i32}` and `{.y: u32, .x: u32}` is as well. Equality and inequality comparisons compare fields using the field order of the left-hand operand and stop once the outcome @@ -804,7 +804,7 @@ type has not yet been decided. > **TODO:** Document that qualified names can be looked up in an incomplete > type, as adopted in -> [p5087: Qualified lookup into types being defined](/proposals/p5087.md). +> [#5087: Qualified lookup into types being defined](/proposals/p005087-qualified-lookup-into-types-being-defined.md). ### `Self` @@ -1144,7 +1144,7 @@ interface would then be part of our [strategy for defining how other interfaces are implemented for data classes](#interfaces-implemented-for-data-classes). **References:** Rationale for this approach is given in proposal -[#722](/proposals/p0722.md#nominal-data-class). +[#722](/proposals/p000722-nominal-classes-and-methods.md#nominal-data-class). ### Member type @@ -1422,9 +1422,9 @@ constructor functions should return the constructed value without copying, as in proposal [#257: Initialization of memory and variables](https://github.com/carbon-language/carbon-lang/pull/257). This means either -[creating the object in the return statement itself](/proposals/p0257.md#function-returns-and-initialization), +[creating the object in the return statement itself](/proposals/p000257-initialization-of-memory-and-variables.md#function-returns-and-initialization), or in -[a `returned var` declaration](/proposals/p0257.md#declared-returned-variable). +[a `returned var` declaration](/proposals/p000257-initialization-of-memory-and-variables.md#declared-returned-variable). As before, instances can be created by casting a struct value into the class type, this time with a `.base` member to initialize the members of the immediate base type. @@ -1710,8 +1710,8 @@ the destructor is virtual or non-virtual, determines which actually pointing to a derived class. **Note:** The names `Deletable` and `Destructible` are -[**placeholders**](/proposals/p1154.md#type-of-type-naming) since they do not -conform to the decision on +[**placeholders**](/proposals/p001154-destructors.md#type-of-type-naming) since +they do not conform to the decision on [question-for-leads issue #1058: "How should interfaces for core functionality be named?"](https://github.com/carbon-language/carbon-lang/issues/1058). | Class | Destructor | `Concrete` | `Deletable` | `Destructible` | @@ -1793,14 +1793,14 @@ Unhandled failure during a destructor call will abort the program. **Alternatives considered:** -- [Types implement destructor interface](/proposals/p1154.md#types-implement-destructor-interface) -- [Prevent virtual function calls in destructors](/proposals/p1154.md#prevent-virtual-function-calls-in-destructors) -- [Allow functions to act as destructors](/proposals/p1154.md#allow-functions-to-act-as-destructors) -- [Allow private destructors](/proposals/p1154.md#allow-private-destructors) -- [Allow multiple conditional destructors](/proposals/p1154.md#allow-multiple-conditional-destructors) -- [Don't distinguish safe and unsafe delete operations](/proposals/p1154.md#dont-distinguish-safe-and-unsafe-delete-operations) -- [Don't allow unsafe delete](/proposals/p1154.md#dont-allow-unsafe-delete) -- [Allow final destructors](/proposals/p1154.md#allow-final-destructors) +- [Types implement destructor interface](/proposals/p001154-destructors.md#types-implement-destructor-interface) +- [Prevent virtual function calls in destructors](/proposals/p001154-destructors.md#prevent-virtual-function-calls-in-destructors) +- [Allow functions to act as destructors](/proposals/p001154-destructors.md#allow-functions-to-act-as-destructors) +- [Allow private destructors](/proposals/p001154-destructors.md#allow-private-destructors) +- [Allow multiple conditional destructors](/proposals/p001154-destructors.md#allow-multiple-conditional-destructors) +- [Don't distinguish safe and unsafe delete operations](/proposals/p001154-destructors.md#dont-distinguish-safe-and-unsafe-delete-operations) +- [Don't allow unsafe delete](/proposals/p001154-destructors.md#dont-allow-unsafe-delete) +- [Allow final destructors](/proposals/p001154-destructors.md#allow-final-destructors) ### Access control @@ -1842,7 +1842,7 @@ and [D](https://wiki.dlang.org/Access_specifiers_and_visibility). **References:** Proposal [#561: Basic classes](https://github.com/carbon-language/carbon-lang/pull/561) included the decision that -[members default to publicly accessible](/proposals/p0561.md#access-control) +[members default to publicly accessible](/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md#access-control) originally asked in issue [#665](https://github.com/carbon-language/carbon-lang/issues/665). @@ -1869,7 +1869,7 @@ C++ and is more orthogonal. **Future work:** `private` will give the member internal linkage unless it needs to be external because it is used in an inline method or template. We may in the future -[add a way to specify internal linkage explicitly](/proposals/p0722.md#specifying-linkage-as-part-of-the-access-modifier). +[add a way to specify internal linkage explicitly](/proposals/p000722-nominal-classes-and-methods.md#specifying-linkage-as-part-of-the-access-modifier). **Open questions:** Using `private` to mean "restricted to this class" matches C++. Other languages support restricting to different scopes: @@ -2278,104 +2278,104 @@ the type of `U.x`." - [#257: Initialization of memory and variables](https://github.com/carbon-language/carbon-lang/pull/257) - - [Require compile-time-proven initialization](/proposals/p0257.md#require-compile-time-proven-initialization) - - [C and C++ uninitialized](/proposals/p0257.md#c-and-c-uninitialized) - - [Allow passing unformed objects to parameters or returning them?](/proposals/p0257.md#allow-passing-unformed-objects-to-parameters-or-returning-them) - - [Allow assigning an unformed object to another unformed object?](/proposals/p0257.md#allow-assigning-an-unformed-object-to-another-unformed-object) - - [Fully destructive move (Rust)](/proposals/p0257.md#fully-destructive-move-rust) - - [Completely non-destructive move (C++)](/proposals/p0257.md#completely-non-destructive-move-c) - - [Named return variable in place of a return type](/proposals/p0257.md#named-return-variable-in-place-of-a-return-type) - - [Allow unformed members](/proposals/p0257.md#allow-unformed-members) + - [Require compile-time-proven initialization](/proposals/p000257-initialization-of-memory-and-variables.md#require-compile-time-proven-initialization) + - [C and C++ uninitialized](/proposals/p000257-initialization-of-memory-and-variables.md#c-and-c-uninitialized) + - [Allow passing unformed objects to parameters or returning them?](/proposals/p000257-initialization-of-memory-and-variables.md#allow-passing-unformed-objects-to-parameters-or-returning-them) + - [Allow assigning an unformed object to another unformed object?](/proposals/p000257-initialization-of-memory-and-variables.md#allow-assigning-an-unformed-object-to-another-unformed-object) + - [Fully destructive move (Rust)](/proposals/p000257-initialization-of-memory-and-variables.md#fully-destructive-move-rust) + - [Completely non-destructive move (C++)](/proposals/p000257-initialization-of-memory-and-variables.md#completely-non-destructive-move-c) + - [Named return variable in place of a return type](/proposals/p000257-initialization-of-memory-and-variables.md#named-return-variable-in-place-of-a-return-type) + - [Allow unformed members](/proposals/p000257-initialization-of-memory-and-variables.md#allow-unformed-members) - [#561: Basic classes: use cases, struct literals, struct types, and future work](https://github.com/carbon-language/carbon-lang/pull/561) - [Early proposal #98](https://github.com/carbon-language/carbon-lang/pull/98) - - [Interfaces implemented for anonymous data classes](/proposals/p0561.md#interfaces-implemented-for-anonymous-data-classes) - - [Access control](/proposals/p0561.md#access-control) - - [Introducer for structural data class types](/proposals/p0561.md#introducer-for-structural-data-class-types) - - [Terminology](/proposals/p0561.md#terminology) + - [Interfaces implemented for anonymous data classes](/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md#interfaces-implemented-for-anonymous-data-classes) + - [Access control](/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md#access-control) + - [Introducer for structural data class types](/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md#introducer-for-structural-data-class-types) + - [Terminology](/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md#terminology) - [#722: Nominal classes and methods](https://github.com/carbon-language/carbon-lang/pull/722) - - [Method syntax](/proposals/p0722.md#method-syntax) - - [Marking mutating methods at the call site](/proposals/p0722.md#marking-mutating-methods-at-the-call-site) - - [Differences between functions and methods](/proposals/p0722.md#differences-between-functions-and-methods) - - [Specifying linkage as part of the access modifier](/proposals/p0722.md#specifying-linkage-as-part-of-the-access-modifier) - - [Nominal data class](/proposals/p0722.md#nominal-data-class) - - [Let constants](/proposals/p0722.md#let-constants) + - [Method syntax](/proposals/p000722-nominal-classes-and-methods.md#method-syntax) + - [Marking mutating methods at the call site](/proposals/p000722-nominal-classes-and-methods.md#marking-mutating-methods-at-the-call-site) + - [Differences between functions and methods](/proposals/p000722-nominal-classes-and-methods.md#differences-between-functions-and-methods) + - [Specifying linkage as part of the access modifier](/proposals/p000722-nominal-classes-and-methods.md#specifying-linkage-as-part-of-the-access-modifier) + - [Nominal data class](/proposals/p000722-nominal-classes-and-methods.md#nominal-data-class) + - [Let constants](/proposals/p000722-nominal-classes-and-methods.md#let-constants) - [#777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777) - - [Classes are final by default](/proposals/p0777.md#classes-are-final-by-default) - - [Allow keywords to be written when they would have no effect](/proposals/p0777.md#allow-keywords-to-be-written-when-they-would-have-no-effect) - - [Different virtual override keywords](/proposals/p0777.md#different-virtual-override-keywords) - - [Different virtual override keyword placement](/proposals/p0777.md#different-virtual-override-keyword-placement) - - [Final methods](/proposals/p0777.md#final-methods) - - [Constructors](/proposals/p0777.md#constructors) - - [Implicit abstract classes](/proposals/p0777.md#implicit-abstract-classes) - - [No extensible objects with non-virtual destructors](/proposals/p0777.md#no-extensible-objects-with-non-virtual-destructors) - - [Separate "exact" and "or derived" variations on types](/proposals/p0777.md#separate-exact-and-or-derived-variations-on-types) - - [Separate "exact" and "or derived" variations on pointers](/proposals/p0777.md#separate-exact-and-or-derived-variations-on-pointers) + - [Classes are final by default](/proposals/p000777-inheritance.md#classes-are-final-by-default) + - [Allow keywords to be written when they would have no effect](/proposals/p000777-inheritance.md#allow-keywords-to-be-written-when-they-would-have-no-effect) + - [Different virtual override keywords](/proposals/p000777-inheritance.md#different-virtual-override-keywords) + - [Different virtual override keyword placement](/proposals/p000777-inheritance.md#different-virtual-override-keyword-placement) + - [Final methods](/proposals/p000777-inheritance.md#final-methods) + - [Constructors](/proposals/p000777-inheritance.md#constructors) + - [Implicit abstract classes](/proposals/p000777-inheritance.md#implicit-abstract-classes) + - [No extensible objects with non-virtual destructors](/proposals/p000777-inheritance.md#no-extensible-objects-with-non-virtual-destructors) + - [Separate "exact" and "or derived" variations on types](/proposals/p000777-inheritance.md#separate-exact-and-or-derived-variations-on-types) + - [Separate "exact" and "or derived" variations on pointers](/proposals/p000777-inheritance.md#separate-exact-and-or-derived-variations-on-pointers) - [#875: Principle: Information accumulation](https://github.com/carbon-language/carbon-lang/pull/875) - Allow information to be used before it is provided - [globally](/proposals/p0875.md#strict-global-consistency), - [within a file](/proposals/p0875.md#context-sensitive-local-consistency), + [globally](/proposals/p000875-principle-information-accumulation.md#strict-global-consistency), + [within a file](/proposals/p000875-principle-information-accumulation.md#context-sensitive-local-consistency), or - [within a top-level declaration](/proposals/p0875.md#top-down-with-minimally-deferred-type-checking). - - [Do not allow inline method bodies to use members before they are declared](/proposals/p0875.md#strict-top-down) - - [Do not allow separate declaration and definition](/proposals/p0875.md#disallow-separate-declaration-and-definition) + [within a top-level declaration](/proposals/p000875-principle-information-accumulation.md#top-down-with-minimally-deferred-type-checking). + - [Do not allow inline method bodies to use members before they are declared](/proposals/p000875-principle-information-accumulation.md#strict-top-down) + - [Do not allow separate declaration and definition](/proposals/p000875-principle-information-accumulation.md#disallow-separate-declaration-and-definition) - [#981: Implicit conversions for aggregates](https://github.com/carbon-language/carbon-lang/pull/981) - - [Field order is not significant](/proposals/p0981.md#field-order-is-not-significant) - - [Different field orders are incompatible](/proposals/p0981.md#different-field-orders-are-incompatible) - - [Explicit instead of implicit conversions](/proposals/p0981.md#explicit-instead-of-implicit-conversions) + - [Field order is not significant](/proposals/p000981-implicit-conversions-for-aggregates.md#field-order-is-not-significant) + - [Different field orders are incompatible](/proposals/p000981-implicit-conversions-for-aggregates.md#different-field-orders-are-incompatible) + - [Explicit instead of implicit conversions](/proposals/p000981-implicit-conversions-for-aggregates.md#explicit-instead-of-implicit-conversions) - [#1154: Destructors](https://github.com/carbon-language/carbon-lang/pull/1154) - - [Types implement destructor interface](/proposals/p1154.md#types-implement-destructor-interface) - - [Prevent virtual function calls in destructors](/proposals/p1154.md#prevent-virtual-function-calls-in-destructors) - - [Allow functions to act as destructors](/proposals/p1154.md#allow-functions-to-act-as-destructors) - - [Allow private destructors](/proposals/p1154.md#allow-private-destructors) - - [Allow multiple conditional destructors](/proposals/p1154.md#allow-multiple-conditional-destructors) - - [Facet type naming](/proposals/p1154.md#type-of-type-naming) - - [Other approaches to extensible classes without vtables](/proposals/p1154.md#other-approaches-to-extensible-classes-without-vtables) + - [Types implement destructor interface](/proposals/p001154-destructors.md#types-implement-destructor-interface) + - [Prevent virtual function calls in destructors](/proposals/p001154-destructors.md#prevent-virtual-function-calls-in-destructors) + - [Allow functions to act as destructors](/proposals/p001154-destructors.md#allow-functions-to-act-as-destructors) + - [Allow private destructors](/proposals/p001154-destructors.md#allow-private-destructors) + - [Allow multiple conditional destructors](/proposals/p001154-destructors.md#allow-multiple-conditional-destructors) + - [Facet type naming](/proposals/p001154-destructors.md#type-of-type-naming) + - [Other approaches to extensible classes without vtables](/proposals/p001154-destructors.md#other-approaches-to-extensible-classes-without-vtables) - [#2107: Clarify rules around `Self` and `.Self`](https://github.com/carbon-language/carbon-lang/pull/2107) - - [`Self` not a keyword](/proposals/p2107.md#self-not-a-keyword) - - [Make `Self` a member of all types](/proposals/p2107.md#make-self-a-member-of-all-types) - - [`where` operator could be associative](/proposals/p2107.md#where-operator-could-be-associative) + - [`Self` not a keyword](/proposals/p002107-clarify-rules-around-self-and-self.md#self-not-a-keyword) + - [Make `Self` a member of all types](/proposals/p002107-clarify-rules-around-self-and-self.md#make-self-a-member-of-all-types) + - [`where` operator could be associative](/proposals/p002107-clarify-rules-around-self-and-self.md#where-operator-could-be-associative) - [#2287: Allow unqualified name lookup for class members](https://github.com/carbon-language/carbon-lang/pull/2287) - - [No unqualified lookup when defining outside a scope](/proposals/p2287.md#no-unqualified-lookup-when-defining-outside-a-scope) + - [No unqualified lookup when defining outside a scope](/proposals/p002287-allow-unqualified-name-lookup.md#no-unqualified-lookup-when-defining-outside-a-scope) - [#2760: Consistent `class` and `interface` syntax](https://github.com/carbon-language/carbon-lang/pull/2760) - - [Use `extends` instead of `extend`](/proposals/p2760.md#use-extends-instead-of-extend) - - [List base class in class declaration](/proposals/p2760.md#list-base-class-in-class-declaration) + - [Use `extends` instead of `extend`](/proposals/p002760-consistent-class-and-interface-syntax.md#use-extends-instead-of-extend) + - [List base class in class declaration](/proposals/p002760-consistent-class-and-interface-syntax.md#list-base-class-in-class-declaration) - [#5017: Destructor syntax](https://github.com/carbon-language/carbon-lang/pull/5017) - - [Destructor syntax options](/proposals/p5017.md#destructor-syntax-options) - - [Destructor name options](/proposals/p5017.md#destructor-name-options) + - [Destructor syntax options](/proposals/p005017-destructor-syntax.md#destructor-syntax-options) + - [Destructor name options](/proposals/p005017-destructor-syntax.md#destructor-name-options) - [#6008: Replace `impl fn` with `override fn`](https://github.com/carbon-language/carbon-lang/pull/6008) - [#7016: Updating `self` syntax and adding `static` fields](https://github.com/carbon-language/carbon-lang/pull/7016) - - [Don't put `self` in either parameter list](/proposals/p7016.md#dont-put-self-in-either-parameter-list) - - [`self` syntax in the deduced parameter list `[]`](/proposals/p7016.md#self-syntax-in-the-deduced-parameter-list-) - - [`class` modifier for non-instance member variables and functions](/proposals/p7016.md#class-modifier-for-non-instance-member-variables-and-functions) - - [Alternative keywords for non-instance member variables](/proposals/p7016.md#alternative-keywords-for-non-instance-member-variables) - - [`shared`](/proposals/p7016.md#shared) - - [`global`](/proposals/p7016.md#global) - - [`static` for non-instance member functions](/proposals/p7016.md#static-for-non-instance-member-functions) - - [`static` for package- and namespace-scope variables](/proposals/p7016.md#static-for-package--and-namespace-scope-variables) - - [Distinct `method` introducer](/proposals/p7016.md#distinct-method-introducer) + - [Don't put `self` in either parameter list](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#dont-put-self-in-either-parameter-list) + - [`self` syntax in the deduced parameter list `[]`](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#self-syntax-in-the-deduced-parameter-list-) + - [`class` modifier for non-instance member variables and functions](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#class-modifier-for-non-instance-member-variables-and-functions) + - [Alternative keywords for non-instance member variables](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#alternative-keywords-for-non-instance-member-variables) + - [`shared`](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#shared) + - [`global`](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#global) + - [`static` for non-instance member functions](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#static-for-non-instance-member-functions) + - [`static` for package- and namespace-scope variables](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#static-for-package--and-namespace-scope-variables) + - [Distinct `method` introducer](/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md#distinct-method-introducer) ## References diff --git a/docs/design/code_and_name_organization/README.md b/docs/design/code_and_name_organization/README.md index 58d3ddc9bac8..096f7b914976 100644 --- a/docs/design/code_and_name_organization/README.md +++ b/docs/design/code_and_name_organization/README.md @@ -648,7 +648,7 @@ When `export` is used as a modifier to `import`, it is still considered to be an Namespaces cannot be exported using a `export ` declaration. It is possible a form of support will be added as -[future work](/proposals/p3938.md#namespaces). +[future work](/proposals/p003938-exporting-imported-names.md#namespaces). Names in other packages also cannot be exported. This covers both possible syntaxes: `export import ` and `export .`. However, a @@ -1016,58 +1016,58 @@ files. This should be part of a larger testing plan. ## Alternatives considered - Packages - - [Name paths for package names](/proposals/p0107.md#name-paths-for-package-names) - - [Referring to the package as `package`](/proposals/p0107.md#referring-to-the-package-as-package) - - [Remove the `library` keyword from `package` and `import`](/proposals/p0107.md#remove-the-library-keyword-from-package-and-import) - - [Rename package concept](/proposals/p0107.md#rename-package-concept) - - [No association between the file system path and library/namespace](/proposals/p0107.md#no-association-between-the-file-system-path-and-librarynamespace) - - [Require the use of the identifier `Main` in package declarations](/proposals/p2550.md#require-the-use-of-the-identifier-main-in-package-declarations) - - [Permit the use of the identifier `Main` in package declarations](/proposals/p2550.md#permit-the-use-of-the-identifier-main-in-package-declarations) - - [Make the main package be unnamed](/proposals/p2550.md#make-the-main-package-be-unnamed) - - [Use a different name for the main package](/proposals/p2550.md#use-a-different-name-for-the-main-package) - - [Use a different name for the entry point](/proposals/p2550.md#use-a-different-name-for-the-entry-point) - - [Distinguish file scope from package scope](/proposals/p2550.md#distinguish-file-scope-from-package-scope) - - [Default to an implementation file for `Main//default` instead of an API file](/proposals/p3403.md#default-to-maindefault-impl-instead-of-maindefault-api) + - [Name paths for package names](/proposals/p000107-code-and-name-organization.md#name-paths-for-package-names) + - [Referring to the package as `package`](/proposals/p000107-code-and-name-organization.md#referring-to-the-package-as-package) + - [Remove the `library` keyword from `package` and `import`](/proposals/p000107-code-and-name-organization.md#remove-the-library-keyword-from-package-and-import) + - [Rename package concept](/proposals/p000107-code-and-name-organization.md#rename-package-concept) + - [No association between the file system path and library/namespace](/proposals/p000107-code-and-name-organization.md#no-association-between-the-file-system-path-and-librarynamespace) + - [Require the use of the identifier `Main` in package declarations](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#require-the-use-of-the-identifier-main-in-package-declarations) + - [Permit the use of the identifier `Main` in package declarations](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#permit-the-use-of-the-identifier-main-in-package-declarations) + - [Make the main package be unnamed](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#make-the-main-package-be-unnamed) + - [Use a different name for the main package](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#use-a-different-name-for-the-main-package) + - [Use a different name for the entry point](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#use-a-different-name-for-the-entry-point) + - [Distinguish file scope from package scope](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#distinguish-file-scope-from-package-scope) + - [Default to an implementation file for `Main//default` instead of an API file](/proposals/p003403-change-main-default-to-an-api-file.md#default-to-maindefault-impl-instead-of-maindefault-api) - Libraries - - [Allow exporting namespaces](/proposals/p0107.md#allow-exporting-namespaces) - - [Allow importing implementation files from within the same library](/proposals/p0107.md#allow-importing-implementation-files-from-within-the-same-library) - - [Alternative library separators and shorthand](/proposals/p0107.md#alternative-library-separators-and-shorthand) - - [Single-word libraries](/proposals/p0107.md#single-word-libraries) - - [Collapse API and implementation file concepts](/proposals/p0107.md#collapse-api-and-implementation-file-concepts) - - [Automatically generating the API separation](/proposals/p0107.md#automatically-generating-the-api-separation) - - [Collapse file and library concepts](/proposals/p0107.md#collapse-file-and-library-concepts) - - [Collapse the library concept into packages](/proposals/p0107.md#collapse-the-library-concept-into-packages) - - [Collapse the package concept into libraries](/proposals/p0107.md#collapse-the-package-concept-into-libraries) - - [Default API to private](/proposals/p0752.md#default-api-to-private) - - [Default `impl` to public](/proposals/p0752.md#default-impl-to-public) - - [Different file type labels](/proposals/p0107.md#different-file-type-labels) - - [Don't default to introducing an API file](/proposals/p3927.md#mandatory-api-or-impl-as-suffix) - - [Function-like syntax](/proposals/p0107.md#function-like-syntax) - - [Inlining from implementation files](/proposals/p0107.md#inlining-from-implementation-files) - - [Library-private access controls](/proposals/p0107.md#library-private-access-controls) - - [Make keywords either optional or required in separate definitions](/proposals/p0752.md#make-keywords-either-optional-or-required-in-separate-definitions) - - [Managing API versus implementation in libraries](/proposals/p0107.md#managing-api-versus-implementation-in-libraries) - - [Multiple API files](/proposals/p0107.md#multiple-api-files) - - [Name paths as library names](/proposals/p0107.md#name-paths-as-library-names) - - [Put the `impl` modifier at the end](/proposals/p3927.md#mandatory-api-or-impl-as-suffix) - - [Put the `impl` modifier before `library`](/proposals/p3927.md#put-the-impl-modifier-before-library) + - [Allow exporting namespaces](/proposals/p000107-code-and-name-organization.md#allow-exporting-namespaces) + - [Allow importing implementation files from within the same library](/proposals/p000107-code-and-name-organization.md#allow-importing-implementation-files-from-within-the-same-library) + - [Alternative library separators and shorthand](/proposals/p000107-code-and-name-organization.md#alternative-library-separators-and-shorthand) + - [Single-word libraries](/proposals/p000107-code-and-name-organization.md#single-word-libraries) + - [Collapse API and implementation file concepts](/proposals/p000107-code-and-name-organization.md#collapse-api-and-implementation-file-concepts) + - [Automatically generating the API separation](/proposals/p000107-code-and-name-organization.md#automatically-generating-the-api-separation) + - [Collapse file and library concepts](/proposals/p000107-code-and-name-organization.md#collapse-file-and-library-concepts) + - [Collapse the library concept into packages](/proposals/p000107-code-and-name-organization.md#collapse-the-library-concept-into-packages) + - [Collapse the package concept into libraries](/proposals/p000107-code-and-name-organization.md#collapse-the-package-concept-into-libraries) + - [Default API to private](/proposals/p000752-api-file-default-public.md#default-api-to-private) + - [Default `impl` to public](/proposals/p000752-api-file-default-public.md#default-impl-to-public) + - [Different file type labels](/proposals/p000107-code-and-name-organization.md#different-file-type-labels) + - [Don't default to introducing an API file](/proposals/p003927-more-consistent-package-syntax.md#mandatory-api-or-impl-as-suffix) + - [Function-like syntax](/proposals/p000107-code-and-name-organization.md#function-like-syntax) + - [Inlining from implementation files](/proposals/p000107-code-and-name-organization.md#inlining-from-implementation-files) + - [Library-private access controls](/proposals/p000107-code-and-name-organization.md#library-private-access-controls) + - [Make keywords either optional or required in separate definitions](/proposals/p000752-api-file-default-public.md#make-keywords-either-optional-or-required-in-separate-definitions) + - [Managing API versus implementation in libraries](/proposals/p000107-code-and-name-organization.md#managing-api-versus-implementation-in-libraries) + - [Multiple API files](/proposals/p000107-code-and-name-organization.md#multiple-api-files) + - [Name paths as library names](/proposals/p000107-code-and-name-organization.md#name-paths-as-library-names) + - [Put the `impl` modifier at the end](/proposals/p003927-more-consistent-package-syntax.md#mandatory-api-or-impl-as-suffix) + - [Put the `impl` modifier before `library`](/proposals/p003927-more-consistent-package-syntax.md#put-the-impl-modifier-before-library) - Imports - - [Block imports](/proposals/p0107.md#block-imports) - - [Block imports of libraries of a single package](/proposals/p0107.md#block-imports-of-libraries-of-a-single-package) - - [Broader imports, either all names or arbitrary code](/proposals/p0107.md#broader-imports-either-all-names-or-arbitrary-code) - - [Direct name imports](/proposals/p0107.md#direct-name-imports) - - [Always include the package name in imports](/proposals/p2550.md#keep-the-package-name-in-imports) + - [Block imports](/proposals/p000107-code-and-name-organization.md#block-imports) + - [Block imports of libraries of a single package](/proposals/p000107-code-and-name-organization.md#block-imports-of-libraries-of-a-single-package) + - [Broader imports, either all names or arbitrary code](/proposals/p000107-code-and-name-organization.md#broader-imports-either-all-names-or-arbitrary-code) + - [Direct name imports](/proposals/p000107-code-and-name-organization.md#direct-name-imports) + - [Always include the package name in imports](/proposals/p002550-simplified-package-declaration-for-the-main-package.md#keep-the-package-name-in-imports) - Exports - - [Other `export` syntax structures](/proposals/p3938.md#other-export-syntax-structures) - - [Other `export name` placements](/proposals/p3938.md#other-export-name-placements) - - [Re-exporting cross-package](/proposals/p3938.md#re-exporting-cross-package) + - [Other `export` syntax structures](/proposals/p003938-exporting-imported-names.md#other-export-syntax-structures) + - [Other `export name` placements](/proposals/p003938-exporting-imported-names.md#other-export-name-placements) + - [Re-exporting cross-package](/proposals/p003938-exporting-imported-names.md#re-exporting-cross-package) - Namespaces - - [File-level namespaces](/proposals/p0107.md#file-level-namespaces) - - [Scoped namespaces](/proposals/p0107.md#scoped-namespaces) - - [Allow prefixing a tuple binding pattern with a namespace](/proposals/p3407.md#allow-prefixing-a-tuple-binding-pattern-with-a-namespace) - - [Allow binding patterns to declare names in multiple namespaces](/proposals/p3407.md#allow-binding-patterns-to-declare-names-in-multiple-namespaces) - - [Allow declaring names in namespaces not owned by the current scope](/proposals/p3407.md#allow-declaring-names-in-namespaces-not-owned-by-the-current-scope) - - [Allow declaring namespaces in scopes other than the file scope](/proposals/p3407.md#allow-declaring-namespaces-in-scopes-other-than-the-file-scope) + - [File-level namespaces](/proposals/p000107-code-and-name-organization.md#file-level-namespaces) + - [Scoped namespaces](/proposals/p000107-code-and-name-organization.md#scoped-namespaces) + - [Allow prefixing a tuple binding pattern with a namespace](/proposals/p003407-clarify-name-bindings-in-namespaces.md#allow-prefixing-a-tuple-binding-pattern-with-a-namespace) + - [Allow binding patterns to declare names in multiple namespaces](/proposals/p003407-clarify-name-bindings-in-namespaces.md#allow-binding-patterns-to-declare-names-in-multiple-namespaces) + - [Allow declaring names in namespaces not owned by the current scope](/proposals/p003407-clarify-name-bindings-in-namespaces.md#allow-declaring-names-in-namespaces-not-owned-by-the-current-scope) + - [Allow declaring namespaces in scopes other than the file scope](/proposals/p003407-clarify-name-bindings-in-namespaces.md#allow-declaring-namespaces-in-scopes-other-than-the-file-scope) ## References diff --git a/docs/design/code_and_name_organization/source_files.md b/docs/design/code_and_name_organization/source_files.md index d6bf03ba6abd..9932570a7a1a 100644 --- a/docs/design/code_and_name_organization/source_files.md +++ b/docs/design/code_and_name_organization/source_files.md @@ -45,9 +45,9 @@ files to NFC as necessary. ## Alternatives considered -- [Character encoding](/proposals/p0142.md#character-encoding-1) -- [Byte order marks](/proposals/p0142.md#byte-order-marks) -- [Normalization forms](/proposals/p0142.md#normalization-forms) +- [Character encoding](/proposals/p000142-unicode-source-files.md#character-encoding-1) +- [Byte order marks](/proposals/p000142-unicode-source-files.md#byte-order-marks) +- [Normalization forms](/proposals/p000142-unicode-source-files.md#normalization-forms) ## References diff --git a/docs/design/control_flow/conditionals.md b/docs/design/control_flow/conditionals.md index f7e9b0732a1d..c924d8924c88 100644 --- a/docs/design/control_flow/conditionals.md +++ b/docs/design/control_flow/conditionals.md @@ -72,9 +72,9 @@ This code will: ## Alternatives considered -- [Optional braces](/proposals/p0623.md#optional-braces) -- [Optional parentheses](/proposals/p0623.md#optional-parentheses) -- [`elif`](/proposals/p0623.md#elif) +- [Optional braces](/proposals/p000623-require-braces.md#optional-braces) +- [Optional parentheses](/proposals/p000623-require-braces.md#optional-parentheses) +- [`elif`](/proposals/p000623-require-braces.md#elif) ## References diff --git a/docs/design/control_flow/loops.md b/docs/design/control_flow/loops.md index be5707e9a863..bdd5639efef1 100644 --- a/docs/design/control_flow/loops.md +++ b/docs/design/control_flow/loops.md @@ -109,14 +109,14 @@ while (!f.EOF()) { ## Alternatives considered -- [Non-C++ syntax](/proposals/p0340.md#non-c-syntax) -- [Initializing variables in the `while`](/proposals/p0340.md#initializing-variables-in-the-while) +- [Non-C++ syntax](/proposals/p000340-while-loops.md#non-c-syntax) +- [Initializing variables in the `while`](/proposals/p000340-while-loops.md#initializing-variables-in-the-while) - `for`: - - [Include semisemi `for` loops](/proposals/p0353.md#include-semisemi-for-loops) - - [Multi-variable bindings](/proposals/p0353.md#multi-variable-bindings) - - [`:` versus `in`](/proposals/p0618.md#-versus-in) -- [Optional braces](/proposals/p0623.md#optional-braces) -- [Optional parentheses](/proposals/p0623.md#optional-parentheses) + - [Include semisemi `for` loops](/proposals/p000353-for-loops.md#include-semisemi-for-loops) + - [Multi-variable bindings](/proposals/p000353-for-loops.md#multi-variable-bindings) + - [`:` versus `in`](/proposals/p000618-var-ordering.md#-versus-in) +- [Optional braces](/proposals/p000623-require-braces.md#optional-braces) +- [Optional parentheses](/proposals/p000623-require-braces.md#optional-parentheses) ## References diff --git a/docs/design/control_flow/return.md b/docs/design/control_flow/return.md index fd10301be520..7da27435d005 100644 --- a/docs/design/control_flow/return.md +++ b/docs/design/control_flow/return.md @@ -168,10 +168,10 @@ avoid copies. ## Alternatives considered -- [Implicit or expression returns](/proposals/p0415.md#implicit-or-expression-returns) -- [Named return variable in place of a return type](/proposals/p0257.md#named-return-variable-in-place-of-a-return-type) -- [Retain the C++ rule](/proposals/p0538.md#retain-the-c-rule) -- [Fully divorce functions and procedures](/proposals/p0538.md#fully-divorce-functions-and-procedures) +- [Implicit or expression returns](/proposals/p000415-syntax-return.md#implicit-or-expression-returns) +- [Named return variable in place of a return type](/proposals/p000257-initialization-of-memory-and-variables.md#named-return-variable-in-place-of-a-return-type) +- [Retain the C++ rule](/proposals/p000538-return-with-no-argument.md#retain-the-c-rule) +- [Fully divorce functions and procedures](/proposals/p000538-return-with-no-argument.md#fully-divorce-functions-and-procedures) ## References diff --git a/docs/design/declaring_entities.md b/docs/design/declaring_entities.md index cd2a666e3d2d..5f8c738382d7 100644 --- a/docs/design/declaring_entities.md +++ b/docs/design/declaring_entities.md @@ -207,28 +207,28 @@ fn ValidUse() -> i32 { ## Alternatives considered -- [Other modifier keyword merging approaches](/proposals/p3762.md#other-modifier-keyword-merging-approaches) -- [No `extern` keyword](/proposals/p3762.md#no-extern-keyword) -- [Looser restrictions on declarations](/proposals/p3762.md#looser-restrictions-on-declarations) -- [`extern` naming](/proposals/p3762.md#extern-naming) -- [Default `extern` to private](/proposals/p3762.md#default-extern-to-private) -- [Opaque types](/proposals/p3762.md#opaque-types) -- [Require a library provide its own `extern` declarations](/proposals/p3762.md#require-a-library-provide-its-own-extern-declarations) -- [Allow cross-package `extern` declarations](/proposals/p3762.md#allow-cross-package-extern-declarations) -- [Use a partially or fully semantic rule](/proposals/p3763.md#use-a-partially-or-fully-semantic-rule) -- [Use package-wide name poisoning](/proposals/p3763.md#use-package-wide-name-poisoning) -- [Allow shadowing in implementation file after use in API file](/proposals/p3763.md#allow-shadowing-in-implementation-file-after-use-in-api-file) -- [Allow multiple non-owning declarations, remove the import requirement, or both](/proposals/p3980.md#allow-multiple-non-owning-declarations-remove-the-import-requirement-or-both) -- [Total number of allowed declarations (owning and non-owning)](/proposals/p3980.md#total-number-of-allowed-declarations-owning-and-non-owning) - - [Do not restrict the number of forward declarations](/proposals/p3980.md#do-not-restrict-the-number-of-forward-declarations) - - [Allow up to two declarations total](/proposals/p3980.md#allow-up-to-two-declarations-total) - - [Allow up to four declarations total](/proposals/p3980.md#allow-up-to-four-declarations-total) -- [Don't require a modifier on the owning declarations](/proposals/p3980.md#dont-require-a-modifier-on-the-owning-declarations) -- [Only require `extern` on the first owning declaration](/proposals/p3980.md#only-require-extern-on-the-first-owning-declaration) -- [Separate require-direct-import from non-owning declarations](/proposals/p3980.md#separate-require-direct-import-from-non-owning-declarations) -- [Other `extern` syntaxes](/proposals/p3980.md#other-extern-syntaxes) -- [Have types with `extern` members re-export them](/proposals/p3980.md#have-types-with-extern-members-re-export-them) -- [Require syntactic matching for `extern library` declarations](/proposals/p3980.md#require-syntactic-matching-for-extern-library-declarations) +- [Other modifier keyword merging approaches](/proposals/p003762-merging-forward-declarations.md#other-modifier-keyword-merging-approaches) +- [No `extern` keyword](/proposals/p003762-merging-forward-declarations.md#no-extern-keyword) +- [Looser restrictions on declarations](/proposals/p003762-merging-forward-declarations.md#looser-restrictions-on-declarations) +- [`extern` naming](/proposals/p003762-merging-forward-declarations.md#extern-naming) +- [Default `extern` to private](/proposals/p003762-merging-forward-declarations.md#default-extern-to-private) +- [Opaque types](/proposals/p003762-merging-forward-declarations.md#opaque-types) +- [Require a library provide its own `extern` declarations](/proposals/p003762-merging-forward-declarations.md#require-a-library-provide-its-own-extern-declarations) +- [Allow cross-package `extern` declarations](/proposals/p003762-merging-forward-declarations.md#allow-cross-package-extern-declarations) +- [Use a partially or fully semantic rule](/proposals/p003763-matching-redeclarations.md#use-a-partially-or-fully-semantic-rule) +- [Use package-wide name poisoning](/proposals/p003763-matching-redeclarations.md#use-package-wide-name-poisoning) +- [Allow shadowing in implementation file after use in API file](/proposals/p003763-matching-redeclarations.md#allow-shadowing-in-implementation-file-after-use-in-api-file) +- [Allow multiple non-owning declarations, remove the import requirement, or both](/proposals/p003980-singular-extern-declarations.md#allow-multiple-non-owning-declarations-remove-the-import-requirement-or-both) +- [Total number of allowed declarations (owning and non-owning)](/proposals/p003980-singular-extern-declarations.md#total-number-of-allowed-declarations-owning-and-non-owning) + - [Do not restrict the number of forward declarations](/proposals/p003980-singular-extern-declarations.md#do-not-restrict-the-number-of-forward-declarations) + - [Allow up to two declarations total](/proposals/p003980-singular-extern-declarations.md#allow-up-to-two-declarations-total) + - [Allow up to four declarations total](/proposals/p003980-singular-extern-declarations.md#allow-up-to-four-declarations-total) +- [Don't require a modifier on the owning declarations](/proposals/p003980-singular-extern-declarations.md#dont-require-a-modifier-on-the-owning-declarations) +- [Only require `extern` on the first owning declaration](/proposals/p003980-singular-extern-declarations.md#only-require-extern-on-the-first-owning-declaration) +- [Separate require-direct-import from non-owning declarations](/proposals/p003980-singular-extern-declarations.md#separate-require-direct-import-from-non-owning-declarations) +- [Other `extern` syntaxes](/proposals/p003980-singular-extern-declarations.md#other-extern-syntaxes) +- [Have types with `extern` members re-export them](/proposals/p003980-singular-extern-declarations.md#have-types-with-extern-members-re-export-them) +- [Require syntactic matching for `extern library` declarations](/proposals/p003980-singular-extern-declarations.md#require-syntactic-matching-for-extern-library-declarations) ## References diff --git a/docs/design/expressions/README.md b/docs/design/expressions/README.md index 9d5486afcc31..5e687f0ef34b 100644 --- a/docs/design/expressions/README.md +++ b/docs/design/expressions/README.md @@ -420,9 +420,9 @@ These are referred to as Other expression documents will list more alternatives; this lists alternatives not noted elsewhere. -- [Total order](/proposals/p0555.md#total-order) -- [Different precedence for different operands](/proposals/p0555.md#different-precedence-for-different-operands) -- [Require less than a partial order](/proposals/p0555.md#require-less-than-a-partial-order) +- [Total order](/proposals/p000555-operator-precedence.md#total-order) +- [Different precedence for different operands](/proposals/p000555-operator-precedence.md#different-precedence-for-different-operands) +- [Require less than a partial order](/proposals/p000555-operator-precedence.md#require-less-than-a-partial-order) ## References diff --git a/docs/design/expressions/arithmetic.md b/docs/design/expressions/arithmetic.md index cf956db76508..f750f6cb2ac0 100644 --- a/docs/design/expressions/arithmetic.md +++ b/docs/design/expressions/arithmetic.md @@ -267,21 +267,21 @@ to give the semantics described above. ## Alternatives considered -- [Use a sufficiently wide result type to avoid overflow](/proposals/p1083.md#use-a-sufficiently-wide-result-type-to-avoid-overflow) -- [Guarantee that the program never proceeds with an incorrect value after overflow](/proposals/p1083.md#guarantee-that-the-program-never-proceeds-with-an-incorrect-value-after-overflow) -- [Guarantee that all integer arithmetic is two's complement](/proposals/p1083.md#guarantee-that-all-integer-arithmetic-is-twos-complement) -- [Treat overflow as an error but don't optimize on it](/proposals/p1083.md#treat-overflow-as-an-error-but-dont-optimize-on-it) -- [Don't let `Unsigned` arithmetic wrap](/proposals/p1083.md#dont-let-unsigned-arithmetic-wrap) -- [Provide separate wrapping types](/proposals/p1083.md#provide-separate-wrapping-types) -- [Do not provide an ordering or division for `uN`](/proposals/p1083.md#do-not-provide-an-ordering-or-division-for-un) -- [Give unary `-` lower precedence](/proposals/p1083.md#give-unary---lower-precedence) -- [Include a unary plus operator](/proposals/p1083.md#include-a-unary-plus-operator) -- [Floating-point modulo operator](/proposals/p1083.md#floating-point-modulo-operator) -- [Provide different division operators](/proposals/p1083.md#provide-different-division-operators) -- [Use different division and modulo semantics](/proposals/p1083.md#use-different-division-and-modulo-semantics) -- [Use different precedence groups for division and multiplication](/proposals/p1083.md#use-different-precedence-groups-for-division-and-multiplication) -- [Use the same precedence group for modulo and multiplication](/proposals/p1083.md#use-the-same-precedence-group-for-modulo-and-multiplication) -- [Use a different spelling for modulo](/proposals/p1083.md#use-a-different-spelling-for-modulo) +- [Use a sufficiently wide result type to avoid overflow](/proposals/p001083-arithmetic-expressions.md#use-a-sufficiently-wide-result-type-to-avoid-overflow) +- [Guarantee that the program never proceeds with an incorrect value after overflow](/proposals/p001083-arithmetic-expressions.md#guarantee-that-the-program-never-proceeds-with-an-incorrect-value-after-overflow) +- [Guarantee that all integer arithmetic is two's complement](/proposals/p001083-arithmetic-expressions.md#guarantee-that-all-integer-arithmetic-is-twos-complement) +- [Treat overflow as an error but don't optimize on it](/proposals/p001083-arithmetic-expressions.md#treat-overflow-as-an-error-but-dont-optimize-on-it) +- [Don't let `Unsigned` arithmetic wrap](/proposals/p001083-arithmetic-expressions.md#dont-let-unsigned-arithmetic-wrap) +- [Provide separate wrapping types](/proposals/p001083-arithmetic-expressions.md#provide-separate-wrapping-types) +- [Do not provide an ordering or division for `uN`](/proposals/p001083-arithmetic-expressions.md#do-not-provide-an-ordering-or-division-for-un) +- [Give unary `-` lower precedence](/proposals/p001083-arithmetic-expressions.md#give-unary---lower-precedence) +- [Include a unary plus operator](/proposals/p001083-arithmetic-expressions.md#include-a-unary-plus-operator) +- [Floating-point modulo operator](/proposals/p001083-arithmetic-expressions.md#floating-point-modulo-operator) +- [Provide different division operators](/proposals/p001083-arithmetic-expressions.md#provide-different-division-operators) +- [Use different division and modulo semantics](/proposals/p001083-arithmetic-expressions.md#use-different-division-and-modulo-semantics) +- [Use different precedence groups for division and multiplication](/proposals/p001083-arithmetic-expressions.md#use-different-precedence-groups-for-division-and-multiplication) +- [Use the same precedence group for modulo and multiplication](/proposals/p001083-arithmetic-expressions.md#use-the-same-precedence-group-for-modulo-and-multiplication) +- [Use a different spelling for modulo](/proposals/p001083-arithmetic-expressions.md#use-a-different-spelling-for-modulo) ## References diff --git a/docs/design/expressions/as_expressions.md b/docs/design/expressions/as_expressions.md index 706a85d62574..68150652baf9 100644 --- a/docs/design/expressions/as_expressions.md +++ b/docs/design/expressions/as_expressions.md @@ -176,11 +176,11 @@ type `type`. The program is invalid if this conversion is not possible. ## Alternatives considered -- [Allow `as` to perform some unsafe conversions](/proposals/p0845.md#allow-as-to-perform-some-unsafe-conversions) -- [Allow `as` to perform two's complement truncation](/proposals/p0845.md#allow-as-to-perform-twos-complement-truncation) -- [`as` only performs implicit conversions](/proposals/p0845.md#as-only-performs-implicit-conversions) -- [Integer to bool conversions](/proposals/p0845.md#integer-to-bool-conversions) -- [Bool to integer conversions](/proposals/p0845.md#bool-to-integer-conversions) +- [Allow `as` to perform some unsafe conversions](/proposals/p000845-as-expressions.md#allow-as-to-perform-some-unsafe-conversions) +- [Allow `as` to perform two's complement truncation](/proposals/p000845-as-expressions.md#allow-as-to-perform-twos-complement-truncation) +- [`as` only performs implicit conversions](/proposals/p000845-as-expressions.md#as-only-performs-implicit-conversions) +- [Integer to bool conversions](/proposals/p000845-as-expressions.md#integer-to-bool-conversions) +- [Bool to integer conversions](/proposals/p000845-as-expressions.md#bool-to-integer-conversions) ## References diff --git a/docs/design/expressions/bitwise.md b/docs/design/expressions/bitwise.md index 4f029575724f..cc31526a5b76 100644 --- a/docs/design/expressions/bitwise.md +++ b/docs/design/expressions/bitwise.md @@ -271,11 +271,11 @@ to give the semantics described above. ## Alternatives considered -- [Use different symbols for bitwise operators](/proposals/p1191.md#use-different-symbols-for-bitwise-operators) -- [Provide different operators for arithmetic and logical shifts](/proposals/p1191.md#provide-different-operators-for-arithmetic-and-logical-shifts) -- [Provide rotate operators](/proposals/p1191.md#provide-rotate-operators) -- [Guarantee the behavior of large shifts](/proposals/p1191.md#guarantee-behavior-of-large-shifts) -- [Support shifting a constant by a variable](/proposals/p1191.md#support-shifting-a-constant-by-a-variable) +- [Use different symbols for bitwise operators](/proposals/p001191-bitwise-and-shift-operators.md#use-different-symbols-for-bitwise-operators) +- [Provide different operators for arithmetic and logical shifts](/proposals/p001191-bitwise-and-shift-operators.md#provide-different-operators-for-arithmetic-and-logical-shifts) +- [Provide rotate operators](/proposals/p001191-bitwise-and-shift-operators.md#provide-rotate-operators) +- [Guarantee the behavior of large shifts](/proposals/p001191-bitwise-and-shift-operators.md#guarantee-behavior-of-large-shifts) +- [Support shifting a constant by a variable](/proposals/p001191-bitwise-and-shift-operators.md#support-shifting-a-constant-by-a-variable) ## References diff --git a/docs/design/expressions/comparison_operators.md b/docs/design/expressions/comparison_operators.md index 3c70f3c172d2..d4397f243d55 100644 --- a/docs/design/expressions/comparison_operators.md +++ b/docs/design/expressions/comparison_operators.md @@ -208,8 +208,8 @@ if (integer as f64 == float) { ``` The two kinds of mixed-type comparison may be -[less efficient](/proposals/p0702.md#performance) than the other kinds due to -the slightly wider domain. +[less efficient](/proposals/p000702-comparison-operators.md#performance) than +the other kinds due to the slightly wider domain. Note that this approach diverges from C++, which would convert both operands to a common type first, sometimes performing a lossy conversion potentially giving @@ -511,12 +511,12 @@ in general. That decision is left to a future proposal. ## Alternatives considered -- [Alternative symbols](/proposals/p0702.md#alternative-symbols) -- [Chained comparisons](/proposals/p0702.md#chained-comparisons-1) -- [Convert operands like C++](/proposals/p0702.md#convert-operands-like-c) -- [Provide a three-way comparison operator](/proposals/p0702.md#provide-a-three-way-comparison-operator) -- [Allow comparisons as the operand of `not`](/proposals/p0702.md#allow-comparisons-as-the-operand-of-not) -- [Rename `OrderedWith` to `ComparableWith`](/proposals/p1178.md#use-comparablewith-instead-of-orderedwith) +- [Alternative symbols](/proposals/p000702-comparison-operators.md#alternative-symbols) +- [Chained comparisons](/proposals/p000702-comparison-operators.md#chained-comparisons-1) +- [Convert operands like C++](/proposals/p000702-comparison-operators.md#convert-operands-like-c) +- [Provide a three-way comparison operator](/proposals/p000702-comparison-operators.md#provide-a-three-way-comparison-operator) +- [Allow comparisons as the operand of `not`](/proposals/p000702-comparison-operators.md#allow-comparisons-as-the-operand-of-not) +- [Rename `OrderedWith` to `ComparableWith`](/proposals/p001178-rework-operator-interfaces.md#use-comparablewith-instead-of-orderedwith) ## References diff --git a/docs/design/expressions/if.md b/docs/design/expressions/if.md index 8ab47552f195..bd08e8fb70fe 100644 --- a/docs/design/expressions/if.md +++ b/docs/design/expressions/if.md @@ -212,18 +212,20 @@ var also_my_string: auto = if cond then my_string else your_string; ## Alternatives considered -- [Provide no conditional expression](/proposals/p0911.md#no-conditional-expression) +- [Provide no conditional expression](/proposals/p000911-conditional-expressions.md#no-conditional-expression) - Use - [`cond ? expr1 : expr2`, like in C and C++](/proposals/p0911.md#use-c-syntax) + [`cond ? expr1 : expr2`, like in C and C++](/proposals/p000911-conditional-expressions.md#use-c-syntax) syntax -- Use [`if (cond) expr1 else expr2`](/proposals/p0911.md#no-then) syntax - Use - [`if (cond) then expr1 else expr2`](/proposals/p0911.md#require-parentheses-around-the-condition) + [`if (cond) expr1 else expr2`](/proposals/p000911-conditional-expressions.md#no-then) + syntax +- Use + [`if (cond) then expr1 else expr2`](/proposals/p000911-conditional-expressions.md#require-parentheses-around-the-condition) syntax - Allow - [`1 + if cond then expr1 else expr2`](/proposals/p0911.md#never-require-enclosing-parentheses) -- [Only require one `impl` to specify the common type if implicit conversions in both directions are possible](/proposals/p0911.md#implicit-conversions-in-both-directions) -- [Introduce special rules for lvalue conditionals](/proposals/p0911.md#support-lvalue-conditionals) + [`1 + if cond then expr1 else expr2`](/proposals/p000911-conditional-expressions.md#never-require-enclosing-parentheses) +- [Only require one `impl` to specify the common type if implicit conversions in both directions are possible](/proposals/p000911-conditional-expressions.md#implicit-conversions-in-both-directions) +- [Introduce special rules for lvalue conditionals](/proposals/p000911-conditional-expressions.md#support-lvalue-conditionals) ## References diff --git a/docs/design/expressions/implicit_conversions.md b/docs/design/expressions/implicit_conversions.md index 8a1c349c8790..8593102b7041 100644 --- a/docs/design/expressions/implicit_conversions.md +++ b/docs/design/expressions/implicit_conversions.md @@ -231,11 +231,11 @@ types. ## Alternatives considered -- [Provide lossy and non-semantics-preserving implicit conversions from C++](/proposals/p0820.md#c-conversions) -- [Provide no implicit conversions](/proposals/p0820.md#no-conversions) -- [Provide no extensibility](/proposals/p0820.md#no-extensibility) -- [Apply implicit conversions transitively](/proposals/p0820.md#transitivity) -- [Do not allow negative constants to convert to unsigned types](/proposals/p1191.md#converting-complements-to-unsigned-types) +- [Provide lossy and non-semantics-preserving implicit conversions from C++](/proposals/p000820-implicit-conversions.md#c-conversions) +- [Provide no implicit conversions](/proposals/p000820-implicit-conversions.md#no-conversions) +- [Provide no extensibility](/proposals/p000820-implicit-conversions.md#no-extensibility) +- [Apply implicit conversions transitively](/proposals/p000820-implicit-conversions.md#transitivity) +- [Do not allow negative constants to convert to unsigned types](/proposals/p001191-bitwise-and-shift-operators.md#converting-complements-to-unsigned-types) ## References diff --git a/docs/design/expressions/indexing.md b/docs/design/expressions/indexing.md index cb1104d1a08a..ffcf2121ce56 100644 --- a/docs/design/expressions/indexing.md +++ b/docs/design/expressions/indexing.md @@ -123,11 +123,11 @@ class Span(T:! type) { ## Alternatives considered -- [Different subscripting syntaxes](/proposals/p2274.md#different-subscripting-syntaxes) -- [Multiple indices](/proposals/p2274.md#multiple-indices) -- [Read-only subscripting](/proposals/p2274.md#read-only-subscripting) -- [Rvalue-only subscripting](/proposals/p2274.md#rvalue-only-subscripting) -- [Map-like subscripting](/proposals/p2274.md#map-like-subscripting) +- [Different subscripting syntaxes](/proposals/p002274-subscript-syntax-and-semantics.md#different-subscripting-syntaxes) +- [Multiple indices](/proposals/p002274-subscript-syntax-and-semantics.md#multiple-indices) +- [Read-only subscripting](/proposals/p002274-subscript-syntax-and-semantics.md#read-only-subscripting) +- [Rvalue-only subscripting](/proposals/p002274-subscript-syntax-and-semantics.md#rvalue-only-subscripting) +- [Map-like subscripting](/proposals/p002274-subscript-syntax-and-semantics.md#map-like-subscripting) ## References diff --git a/docs/design/expressions/literals.md b/docs/design/expressions/literals.md index 6712ef122da1..4a5b65664004 100644 --- a/docs/design/expressions/literals.md +++ b/docs/design/expressions/literals.md @@ -189,10 +189,10 @@ var v: i8 = OneHigher(255); ### Alternatives Considered -- [Use an ordinary integer or floating-point type for literals](/proposals/p0144.md#use-an-ordinary-integer-or-floating-point-type-for-literals) -- [Use same type for all literals](/proposals/p0144.md#use-same-type-for-all-literals) -- [Allow leading `-` in literal tokens](/proposals/p0144.md#allow-leading---in-literal-tokens) -- [Forbidding floating-point ties](/proposals/p0866.md#alternatives-considered) +- [Use an ordinary integer or floating-point type for literals](/proposals/p000144-numeric-literal-semantics.md#use-an-ordinary-integer-or-floating-point-type-for-literals) +- [Use same type for all literals](/proposals/p000144-numeric-literal-semantics.md#use-same-type-for-all-literals) +- [Allow leading `-` in literal tokens](/proposals/p000144-numeric-literal-semantics.md#allow-leading---in-literal-tokens) +- [Forbidding floating-point ties](/proposals/p000866-allow-ties-in-floating-literals.md#alternatives-considered) ## Numeric type literals @@ -237,10 +237,10 @@ as a 32-bit two's complement signed integer. `Main` then returns the output of ### Alternatives considered -- [C++ LP64 convention](/proposals/p2015.md#c-lp64-convention) -- [Type name with length suffix](/proposals/p2015.md#type-name-with-length-suffix) -- [Uppercase suffixes](/proposals/p2015.md#uppercase-suffixes) -- [Additional bit sizes](/proposals/p2015.md#additional-bit-sizes) +- [C++ LP64 convention](/proposals/p002015-numeric-type-literal-syntax.md#c-lp64-convention) +- [Type name with length suffix](/proposals/p002015-numeric-type-literal-syntax.md#type-name-with-length-suffix) +- [Uppercase suffixes](/proposals/p002015-numeric-type-literal-syntax.md#uppercase-suffixes) +- [Additional bit sizes](/proposals/p002015-numeric-type-literal-syntax.md#additional-bit-sizes) ## String literals diff --git a/docs/design/expressions/logical_operators.md b/docs/design/expressions/logical_operators.md index 12964f7eba88..a29a422705cd 100644 --- a/docs/design/expressions/logical_operators.md +++ b/docs/design/expressions/logical_operators.md @@ -136,13 +136,13 @@ also customize how `and`, `or`, and `not` treats them. ## Alternatives considered -- [Use punctuation spelling for all three operators](/proposals/p0680.md#use-punctuation-spelling-for-all-three-operators) -- [Precedence of AND versus OR](/proposals/p0680.md#precedence-of-and-versus-or) -- [Precedence of NOT](/proposals/p0680.md#precedence-of-not) -- [Punctuation form of NOT](/proposals/p0680.md#punctuation-form-of-not) -- [Two forms of NOT](/proposals/p0680.md#two-forms-of-not) -- [Repeated NOT](/proposals/p0680.md#repeated-not) -- [AND and OR produce the decisive value](/proposals/p0680.md#and-and-or-produce-the-decisive-value) +- [Use punctuation spelling for all three operators](/proposals/p000680-and-or-not.md#use-punctuation-spelling-for-all-three-operators) +- [Precedence of AND versus OR](/proposals/p000680-and-or-not.md#precedence-of-and-versus-or) +- [Precedence of NOT](/proposals/p000680-and-or-not.md#precedence-of-not) +- [Punctuation form of NOT](/proposals/p000680-and-or-not.md#punctuation-form-of-not) +- [Two forms of NOT](/proposals/p000680-and-or-not.md#two-forms-of-not) +- [Repeated NOT](/proposals/p000680-and-or-not.md#repeated-not) +- [AND and OR produce the decisive value](/proposals/p000680-and-or-not.md#and-and-or-produce-the-decisive-value) ## References diff --git a/docs/design/expressions/member_access.md b/docs/design/expressions/member_access.md index a2ec577f0381..3955b9812283 100644 --- a/docs/design/expressions/member_access.md +++ b/docs/design/expressions/member_access.md @@ -33,11 +33,12 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ## Overview -> **TODO:** [p3720: Member binding operators](/proposals/p3720.md) introduces an -> additional "member binding" step, redefines simple member access in terms of -> compound member access, and defines compound member access in terms of calls -> to user-implementable interface methods. This document must be updated to -> reflect those changes. +> **TODO:** > +> [#3720: Member binding operators](/proposals/p003720-member-binding-operators.md) +> introduces an additional "member binding" step, redefines simple member access +> in terms of compound member access, and defines compound member access in +> terms of calls to user-implementable interface methods. This document must be +> updated to reflect those changes. A _qualified name_ is a [word](../lexical_conventions/words.md) that is preceded by a period or a rightward arrow. The name is found within a contextually @@ -945,9 +946,9 @@ var n: i32 = 1 + X.Y; ## Alternatives considered -- [Separate syntax for static versus dynamic access, such as `::` versus `.`](/proposals/p0989.md#separate-syntax-for-static-versus-dynamic-access) -- [Use a different lookup rule for names in templates](/proposals/p0989.md#use-a-different-lookup-rule-in-templates) -- [Meaning of `Type.Interface`](/proposals/p0989.md#meaning-of-typeinterface) +- [Separate syntax for static versus dynamic access, such as `::` versus `.`](/proposals/p000989-member-access-expressions.md#separate-syntax-for-static-versus-dynamic-access) +- [Use a different lookup rule for names in templates](/proposals/p000989-member-access-expressions.md#use-a-different-lookup-rule-in-templates) +- [Meaning of `Type.Interface`](/proposals/p000989-member-access-expressions.md#meaning-of-typeinterface) ## References diff --git a/docs/design/expressions/pointer_operators.md b/docs/design/expressions/pointer_operators.md index a6b997d501ab..07ba6d5013f5 100644 --- a/docs/design/expressions/pointer_operators.md +++ b/docs/design/expressions/pointer_operators.md @@ -50,8 +50,8 @@ full details, see the [precedence graph](README.md#precedence). ## Alternatives considered -- [Alternative pointer syntaxes](/proposals/p2006.md#alternative-pointer-syntaxes) +- [Alternative pointer syntaxes](/proposals/p002006-values-variables-pointers-and-references.md#alternative-pointer-syntaxes) ## References -- [Proposal #2006: Values, variables, and pointers](/proposals/p2006.md) +- [Proposal #2006: Values, variables, and pointers](/proposals/p002006-values-variables-pointers-and-references.md) diff --git a/docs/design/expressions/type_operators.md b/docs/design/expressions/type_operators.md index b849756c69f9..1d75ff17b476 100644 --- a/docs/design/expressions/type_operators.md +++ b/docs/design/expressions/type_operators.md @@ -58,10 +58,10 @@ with non-type operators. ## Alternatives considered -- [Alternative pointer syntaxes](/proposals/p2006.md#alternative-pointer-syntaxes) -- [Alternative syntaxes for locals](/proposals/p2006.md#alternative-syntaxes-for-locals) -- [Make `const` a postfix rather than prefix operator](/proposals/p2006.md#make-const-a-postfix-rather-than-prefix-operator) +- [Alternative pointer syntaxes](/proposals/p002006-values-variables-pointers-and-references.md#alternative-pointer-syntaxes) +- [Alternative syntaxes for locals](/proposals/p002006-values-variables-pointers-and-references.md#alternative-syntaxes-for-locals) +- [Make `const` a postfix rather than prefix operator](/proposals/p002006-values-variables-pointers-and-references.md#make-const-a-postfix-rather-than-prefix-operator) ## References -- [Proposal #2006: Values, variables, and pointers](/proposals/p2006.md) +- [Proposal #2006: Values, variables, and pointers](/proposals/p002006-values-variables-pointers-and-references.md) diff --git a/docs/design/functions.md b/docs/design/functions.md index 4bc2e9d59a29..f9fe4600323c 100644 --- a/docs/design/functions.md +++ b/docs/design/functions.md @@ -26,10 +26,10 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception > **TODO:** Update this document to reflect the introduction of function values, > function types, and the `Call` interface in -> [p2875: Functions, function types, and function calls](/proposals/p2875.md). +> [#2875: Functions, function types, and function calls](/proposals/p002875-functions-function-types-and-function-calls.md). > **TODO:** Update this document to reflect the changes to named functions in -> [p3848: Lambdas](/proposals/p3848.md). +> [#3848: Lambdas](/proposals/p003848-lambdas.md). Functions are the core building block for applications. Carbon's basic function syntax is: @@ -170,10 +170,10 @@ Other designs build upon basic function syntax to add advanced features: ## Alternatives considered -- [Function keyword](/proposals/p0438.md#function-keyword) -- [Only allow `auto` return types if parameters are compile-time](/proposals/p0826.md#only-allow-auto-return-types-if-parameters-are-generic) -- [Provide alternate function syntax for concise return type inference](/proposals/p0826.md#provide-alternate-function-syntax-for-concise-return-type-inference) -- [Allow separate declaration and definition](/proposals/p0826.md#allow-separate-declaration-and-definition) +- [Function keyword](/proposals/p000438-functions.md#function-keyword) +- [Only allow `auto` return types if parameters are compile-time](/proposals/p000826-function-return-type-inference.md#only-allow-auto-return-types-if-parameters-are-generic) +- [Provide alternate function syntax for concise return type inference](/proposals/p000826-function-return-type-inference.md#provide-alternate-function-syntax-for-concise-return-type-inference) +- [Allow separate declaration and definition](/proposals/p000826-function-return-type-inference.md#allow-separate-declaration-and-definition) ## References diff --git a/docs/design/generics/details.md b/docs/design/generics/details.md index 03bd9f57de8f..aa67f2ba2cae 100644 --- a/docs/design/generics/details.md +++ b/docs/design/generics/details.md @@ -333,7 +333,7 @@ and doesn't change afterwards. **References:** Carbon's interface implementation syntax was first defined in [proposal #553](https://github.com/carbon-language/carbon-lang/pull/553). In particular, see -[the alternatives considered](/proposals/p0553.md#interface-implementation-syntax). +[the alternatives considered](/proposals/p000553-generics-details-part-1.md#interface-implementation-syntax). This syntax was changed to use `extend` in [proposal #2760: Consistent `class` and `interface` syntax](https://github.com/carbon-language/carbon-lang/pull/2760). @@ -450,7 +450,7 @@ impl Point_ExtendForward as Vector { > **TODO:** The second `impl` in this example is no longer a valid redeclaration > of the first after -> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md). +> [#5366: The name of an `impl` in `class` scope](/proposals/p005366-the-name-of-an-impl-in-class-scope.md). More about forward declaring implementations in [its dedicated section](#declaring-implementations). @@ -1346,7 +1346,7 @@ fn DoHashAndEquals[T:! Hashable](x: T) { > **TODO:** Update this section as needed to reflect the fact that an impl of an > interface doesn't impl the interfaces it extends, as adopted in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). When implementing an interface, we allow implementing the aliased names as well. In the case of `Hashable` above, this includes all the members of `Equatable`, @@ -1376,7 +1376,7 @@ We expect this concept to be common enough to warrant dedicated `interface` syntax: > **TODO:** Update this section to reflect the new syntax adopted in -> [p5337: Interface extension and `final impl` update](/proposals/p5337.md). +> [#5337: Interface extension and `final impl` update](/proposals/p005337-interface-extension-and-final-impl-update.md). ```carbon interface Equatable { fn Equals(self, rhs: Self) -> bool; } @@ -1588,7 +1588,7 @@ interface MovieCodec { #### Diamond dependency issue > **TODO:** Update this section to reflect the changes in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). Consider this set of interfaces, simplified from [this example generic graph library doc](https://docs.google.com/document/d/15Brjv8NO_96jseSesqer5HbghqSTJICJ_fTaZOH0Mg4/edit?usp=sharing&resourcekey=0-CYSbd6-xF8vYHv9m1rolEQ): @@ -2144,7 +2144,7 @@ keyword `private` before `adapt`, so you might write > **TODO:** Update this section to reflect the new rules and guidance on > associated constants in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). In addition to associated methods, we allow other kinds of [associated entities](terminology.md#associated-entity). For consistency, we use @@ -2275,7 +2275,7 @@ type. > **TODO:** Document rules on where associated function implementations can be > declared, as adopted in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). ## Associated facets @@ -2344,7 +2344,7 @@ impl VeryLongTypeName as Add ``` > **Alternatives considered:** See -> [other syntax options considered in #731 for specifying associated facets](/proposals/p0731.md#syntax-for-associated-constants). +> [other syntax options considered in #731 for specifying associated facets](/proposals/p000731-generics-details-2-adapters-associated-types-parameterized-interfaces.md#syntax-for-associated-constants). > In particular, it was deemed that > [Swift's approach of inferring an associated facet from method signatures in the impl](https://docs.swift.org/swift-book/LanguageGuide/Generics.html#ID190) > was unneeded complexity. @@ -2727,15 +2727,15 @@ Implements constraints switched to using the `impls` keyword in **Alternatives considered:** -- [Different equality constraint operators for symbolic and constants](/proposals/p2173.md#status-quo) -- [Single one-step equality constraint operators that merges constraints](/proposals/p2173.md#equal-types-with-different-interfaces) -- [Restrict constraints to allow computable type equality](/proposals/p2173.md#restrict-constraints-to-allow-computable-type-equality) -- [Find a fully transitive approach to type equality](/proposals/p2173.md#find-a-fully-transitive-approach-to-type-equality) -- [Different syntax for rewrite constraint](/proposals/p2173.md#different-syntax-for-rewrite-constraint) -- [Different syntax for same-type constraint](/proposals/p2173.md#different-syntax-for-same-type-constraint) -- [Required ordering for rewrites](/proposals/p2173.md#required-ordering-for-rewrites) -- [Multi-constraint `where` clauses](/proposals/p2173.md#multi-constraint-where-clauses) -- [Rewrite constraints in `require` constraints](/proposals/p2173.md#rewrite-constraints-in-impl-as-constraints) +- [Different equality constraint operators for symbolic and constants](/proposals/p002173-associated-constant-assignment-versus-equality.md#status-quo) +- [Single one-step equality constraint operators that merges constraints](/proposals/p002173-associated-constant-assignment-versus-equality.md#equal-types-with-different-interfaces) +- [Restrict constraints to allow computable type equality](/proposals/p002173-associated-constant-assignment-versus-equality.md#restrict-constraints-to-allow-computable-type-equality) +- [Find a fully transitive approach to type equality](/proposals/p002173-associated-constant-assignment-versus-equality.md#find-a-fully-transitive-approach-to-type-equality) +- [Different syntax for rewrite constraint](/proposals/p002173-associated-constant-assignment-versus-equality.md#different-syntax-for-rewrite-constraint) +- [Different syntax for same-type constraint](/proposals/p002173-associated-constant-assignment-versus-equality.md#different-syntax-for-same-type-constraint) +- [Required ordering for rewrites](/proposals/p002173-associated-constant-assignment-versus-equality.md#required-ordering-for-rewrites) +- [Multi-constraint `where` clauses](/proposals/p002173-associated-constant-assignment-versus-equality.md#multi-constraint-where-clauses) +- [Rewrite constraints in `require` constraints](/proposals/p002173-associated-constant-assignment-versus-equality.md#rewrite-constraints-in-impl-as-constraints) #### Recursive constraints @@ -2927,21 +2927,22 @@ Note that `T:! C where .R = i32` can result in a type `T.R` whose behavior is different from the behavior of `T.R` given `T:! C`. For example, member lookup into `T.R` can find different results and operations can therefore have different behavior. However, this does not violate -[coherence](/proposals/p2173.md#coherence) because the facet types `C` and -`C where .R = i32` don't differ by merely having more type information; rather, -they are different facet types that have an isomorphic set of values, somewhat -like `i32` and `u32`. An `=` constraint is not merely learning a new fact about -a type, it is requesting different behavior. +[coherence](/proposals/p002173-associated-constant-assignment-versus-equality.md#coherence) +because the facet types `C` and `C where .R = i32` don't differ by merely having +more type information; rather, they are different facet types that have an +isomorphic set of values, somewhat like `i32` and `u32`. An `=` constraint is +not merely learning a new fact about a type, it is requesting different +behavior. This approach has some good properties that [same-type constraints](#same-type-constraints) have problems with: -- [Equal types with different interfaces](/proposals/p2173.md#equal-types-with-different-interfaces): +- [Equal types with different interfaces](/proposals/p002173-associated-constant-assignment-versus-equality.md#equal-types-with-different-interfaces): When an associated facet is constrained to be a concrete type, it is desirable for the associated facet to behave like that concrete type. -- [Type canonicalization](/proposals/p2173.md#type-canonicalization): to - enable efficient type equality. -- [Transitivity of equality of types](/proposals/p2173.md#transitivity-of-equality) +- [Type canonicalization](/proposals/p002173-associated-constant-assignment-versus-equality.md#type-canonicalization): + to enable efficient type equality. +- [Transitivity of equality of types](/proposals/p002173-associated-constant-assignment-versus-equality.md#transitivity-of-equality) The precise rules governing rewrite constraints are described in [an appendix](appendix-rewrite-constraints.md). @@ -3560,7 +3561,7 @@ redundant ways to express a restriction, following the **Alternative considered:** This rule was added in proposal [#2376](https://github.com/carbon-language/carbon-lang/pull/2376), which -[considered whether this rule should be added](/proposals/p2376.md#alternatives-considered). +[considered whether this rule should be added](/proposals/p002376-constraints-must-use-self.md#alternatives-considered). ### Referencing names in the interface being defined @@ -4094,8 +4095,8 @@ There are four facet types related to specific optimizations. **Note:** The names `Deletable` and `Destructible` are -[**placeholders**](/proposals/p1154.md#type-of-type-naming) since they do not -conform to the decision on +[**placeholders**](/proposals/p001154-destructors.md#type-of-type-naming) since +they do not conform to the decision on [question-for-leads issue #1058: "How should interfaces for core functionality be named?"](https://github.com/carbon-language/carbon-lang/issues/1058). The facet types `Concrete`, `Deletable`, and `TrivialDestructor` all extend @@ -4598,7 +4599,7 @@ unambiguously picking one as most specific. Only the implementing interface and types (self type and type parameters) in the type structure are relevant here; an interface mentioned in a constraint is not sufficient since it -[need not be imported](/proposals/p0920.md#orphan-rule-could-consider-interface-requirements-in-blanket-impls). +[need not be imported](/proposals/p000920-generic-blanket-impls-details-5.md#orphan-rule-could-consider-interface-requirements-in-blanket-impls). Since Carbon in addition requires there be no cyclic library dependencies, we conclude that there is at most one library that can contain `impl` definitions @@ -4631,7 +4632,7 @@ difference. #### Prioritization rule > **TODO:** Document the changes to prioritization adopted in -> [p5337: Interface extension and `final impl` update](/proposals/p5337.md). +> [#5337: Interface extension and `final impl` update](/proposals/p005337-interface-extension-and-final-impl-update.md). Since at most one library can contain `impl` definitions with a given type structure, all `impl` definitions with a given type structure must be in the @@ -4856,7 +4857,7 @@ count decreases. So `Optional(Optional(i32))` is strictly more complicated than This rule, when combined with [the acyclic rule](#acyclic-rule) that a query can't repeat exactly, -[guarantees termination](/proposals/p2687.md#proof-of-termination). +[guarantees termination](/proposals/p002687-termination-algorithm-for-impl-selection.md#proof-of-termination). Consider the example from before, @@ -4920,12 +4921,12 @@ let V:! B = i32; > **Alternatives considered:** > -> - [Recursion limit](/proposals/p2687.md#problem) -> - [Measure complexity using type tree depth](/proposals/p2687.md#measure-complexity-using-type-tree-depth) -> - [Consider each type parameter in an `impl` declaration separately](/proposals/p2687.md#consider-each-type-parameter-in-an-impl-declaration-separately) -> - [Consider types in the interface being implemented as distinct](/proposals/p2687.md#consider-types-in-the-interface-being-implemented-as-distinct) -> - [Require some count to decrease](/proposals/p2687.md#require-some-count-to-decrease) -> - [Require non-type values to stay the same](/proposals/p2687.md#require-non-type-values-to-stay-the-same) +> - [Recursion limit](/proposals/p002687-termination-algorithm-for-impl-selection.md#problem) +> - [Measure complexity using type tree depth](/proposals/p002687-termination-algorithm-for-impl-selection.md#measure-complexity-using-type-tree-depth) +> - [Consider each type parameter in an `impl` declaration separately](/proposals/p002687-termination-algorithm-for-impl-selection.md#consider-each-type-parameter-in-an-impl-declaration-separately) +> - [Consider types in the interface being implemented as distinct](/proposals/p002687-termination-algorithm-for-impl-selection.md#consider-types-in-the-interface-being-implemented-as-distinct) +> - [Require some count to decrease](/proposals/p002687-termination-algorithm-for-impl-selection.md#require-some-count-to-decrease) +> - [Require non-type values to stay the same](/proposals/p002687-termination-algorithm-for-impl-selection.md#require-non-type-values-to-stay-the-same) > **References:** This algorithm is from proposal > [#2687: Termination algorithm for impl selection](https://github.com/carbon-language/carbon-lang/pull/2687), @@ -5033,7 +5034,7 @@ class Optional(T:! type) { > **TODO:** Update the following passage to reflect the relaxed overlap rule > adopted in -> [p5337: Interface extension and `final impl` update](/proposals/p5337.md). +> [#5337: Interface extension and `final impl` update](/proposals/p005337-interface-extension-and-final-impl-update.md). This prevents any higher-priority impl that overlaps a final impl from being defined unless it agrees with the `final` impl on the overlap. Overlap is @@ -5074,13 +5075,13 @@ fn F[T:! type](x: T) { > **Alternatives considered:** > -> - [Allow interfaces with member functions to compare equal](/proposals/p2868.md#allow-interfaces-with-member-functions-to-compare-equal) +> - [Allow interfaces with member functions to compare equal](/proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md#allow-interfaces-with-member-functions-to-compare-equal) > - Mark associated constants as `final` instead of an `impl` declaration, in > proposals -> [#983](/proposals/p0983.md#final-associated-constants-instead-of-final-impls) +> [#983](/proposals/p000983-generics-details-7-final-impls.md#final-associated-constants-instead-of-final-impls) > and -> [#2868](/proposals/p2868.md#mark-associated-constants-as-final-instead-of-an-impl-declaration) -> - [Prioritize a `final impl` over a more specific `impl` on the overlap](/proposals/p2868.md#prioritize-a-final-impl-over-a-more-specific-impl-on-the-overlap) +> [#2868](/proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md#mark-associated-constants-as-final-instead-of-an-impl-declaration) +> - [Prioritize a `final impl` over a more specific `impl` on the overlap](/proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md#prioritize-a-final-impl-over-a-more-specific-impl-on-the-overlap) #### Libraries that can contain a `final` impl @@ -5169,7 +5170,7 @@ differences between the Carbon design and Rust plans: > **TODO:** Update this section to distinguish between _defined_ and _complete_, > as adopted in -> [p5087: Qualified lookup into types being defined](/proposals/p5087.md). +> [#5087: Qualified lookup into types being defined](/proposals/p005087-qualified-lookup-into-types-being-defined.md). Interfaces, named constraints, and their implementations may be forward declared and then later defined. This is needed to allow cyclic references, for example @@ -5191,7 +5192,7 @@ used. > **TODO:** Update this section to reflect the additional things you can do with > a defined but incomplete type, as adoped in -> [p5087: Qualified lookup into types being defined](/proposals/p5087.md). +> [#5087: Qualified lookup into types being defined](/proposals/p005087-qualified-lookup-into-types-being-defined.md). The declaration for an interface or named constraint consists of: @@ -5280,7 +5281,7 @@ An incomplete `C` cannot be used in the following contexts: ### Declaring implementations > **TODO:** Update this section to reflect the new rules adopted in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). The declaration of an interface implementation consists of: @@ -5298,7 +5299,7 @@ The declaration of an interface implementation consists of: [associated facets](#associated-facets). > **TODO:** Document the redeclaration syntax `impl C.(as I)` adopted in -> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md). +> [#5366: The name of an `impl` in `class` scope](/proposals/p005366-the-name-of-an-impl-in-class-scope.md). **Note:** The type before the `as` is required except in class scope, where it defaults to `Self` as described in the @@ -5340,9 +5341,10 @@ these rules: ### Matching and agreeing > **TODO:** Update this section to reflect the new terminology and rules adopted -> in [p3763: Matching redeclarations](/proposals/p3763.md), and the new rules -> adopted in -> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md). +> in +> [#3763: Matching redeclarations](/proposals/p003763-matching-redeclarations.md), +> and the new rules adopted in +> [#5168: Forward `impl` declaration of an incomplete interface](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md). Carbon needs to determine if two declarations match in order to say which definition a forward declaration corresponds to and to verify that nothing is @@ -5381,7 +5383,7 @@ expressions match along with > **TODO:** Document the matching rules for the redeclaration syntax > `impl C.(as I)` adopted in -> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md). +> [#5366: The name of an `impl` in `class` scope](/proposals/p005366-the-name-of-an-impl-in-class-scope.md). For implementations to agree: @@ -5921,7 +5923,7 @@ interface B(T:! type) { An implementation of `B` for a set of types can only be valid if there is a visible implementation of `A` with the same `T` parameter for those types with the `.Result` associated facet set to `i32`. That is -[not sufficient](/proposals/p1088.md#less-strict-about-requirements-with-where-clauses), +[not sufficient](/proposals/p001088-generic-details-10-interface-implemented-requirements.md#less-strict-about-requirements-with-where-clauses), though, unless the implementation of `A` can't be specialized, either because it is [marked `final`](#final-impl-declarations) or is not [parameterized](#parameterized-impl-declarations). Implementations in other @@ -6636,7 +6638,8 @@ class Optional(T:! Movable) { ``` > **Alternative considered:** Direct support for specialization of types was -> considered in [proposal #1146](/proposals/p1146.md#alternatives-considered). +> considered in +> [proposal #1146](/proposals/p001146-generic-details-12-parameterized-types.md#alternatives-considered). ## Future work @@ -6737,7 +6740,7 @@ template parameters. For example, we might support a predicate that constrains an integer to live inside a specified range. See [question-for-leads issue #2153: Checked generics calling templates](https://github.com/carbon-language/carbon-lang/issues/2153) and -[future work in proposal #2200: Template generics](/proposals/p2200.md#predicates-constraints-on-values). +[future work in proposal #2200: Template generics](/proposals/p002200-template-generics.md#predicates-constraints-on-values). ## References diff --git a/docs/design/lambdas.md b/docs/design/lambdas.md index 3e1505296d70..172a149430a0 100644 --- a/docs/design/lambdas.md +++ b/docs/design/lambdas.md @@ -481,7 +481,7 @@ function fields with a `self` parameter. ## Alternatives considered -- [Terse vs Elaborated](/proposals/p3848.md#alternative-considered-terse-vs-elaborated) -- [Sigil](/proposals/p3848.md#alternative-considered-sigil) -- [Additional Positional Parameter Restriction](/proposals/p3848.md#alternative-considered-additional-positional-parameter-restriction) -- [Recursive Self](/proposals/p3848.md#alternative-considered-recursive-self) +- [Terse vs Elaborated](/proposals/p003848-lambdas.md#alternative-considered-terse-vs-elaborated) +- [Sigil](/proposals/p003848-lambdas.md#alternative-considered-sigil) +- [Additional Positional Parameter Restriction](/proposals/p003848-lambdas.md#alternative-considered-additional-positional-parameter-restriction) +- [Recursive Self](/proposals/p003848-lambdas.md#alternative-considered-recursive-self) diff --git a/docs/design/lexical_conventions/comments.md b/docs/design/lexical_conventions/comments.md index 9affbb873d4f..91a3263d566d 100644 --- a/docs/design/lexical_conventions/comments.md +++ b/docs/design/lexical_conventions/comments.md @@ -46,11 +46,11 @@ line in the region. ## Alternatives considered -- [Intra-line comments](/proposals/p0198.md#intra-line-comments) -- [Multi-line text comments](/proposals/p0198.md#multi-line-text-comments) -- [Block comments](/proposals/p0198.md#block-comments-2) -- [Documentation comments](/proposals/p0198.md#documentation-comments) -- [Code folding comments](/proposals/p0198.md#code-folding-comments) +- [Intra-line comments](/proposals/p000198-comments.md#intra-line-comments) +- [Multi-line text comments](/proposals/p000198-comments.md#multi-line-text-comments) +- [Block comments](/proposals/p000198-comments.md#block-comments-2) +- [Documentation comments](/proposals/p000198-comments.md#documentation-comments) +- [Code folding comments](/proposals/p000198-comments.md#code-folding-comments) ## References diff --git a/docs/design/lexical_conventions/numeric_literals.md b/docs/design/lexical_conventions/numeric_literals.md index f708f497c73e..5314e43f42fa 100644 --- a/docs/design/lexical_conventions/numeric_literals.md +++ b/docs/design/lexical_conventions/numeric_literals.md @@ -138,17 +138,17 @@ cases for the goal of not leaving room for a lower level language: ## Alternatives considered -- [Integer bases](/proposals/p0143.md#integer-bases) - - [Octal literals](/proposals/p0143.md#octal-literals) - - [Decimal literals](/proposals/p0143.md#decimal-literals) - - [Case sensitivity](/proposals/p0143.md#case-sensitivity) -- [Real number syntax](/proposals/p0143.md#real-number-syntax) - - [Disallow ties](/proposals/p0866.md) -- [Digit separator syntax](/proposals/p0143.md#digit-separator-syntax) - - [3-digit decimal groupings](/proposals/p1983.md#3-digit-decimal-groupings) - - [2-digit or 4-digit hexadecimal digit groupings](/proposals/p1983.md#2-digit-or-4-digit-hexadecimal-digit-groupings) - - [Disallow digit separators in fractions](/proposals/p1983.md#disallow-digit-separators-in-fractions) -- [No octal literals](/proposals/p6910.md#no-octal-literals) +- [Integer bases](/proposals/p000143-numeric-literals.md#integer-bases) + - [Octal literals](/proposals/p000143-numeric-literals.md#octal-literals) + - [Decimal literals](/proposals/p000143-numeric-literals.md#decimal-literals) + - [Case sensitivity](/proposals/p000143-numeric-literals.md#case-sensitivity) +- [Real number syntax](/proposals/p000143-numeric-literals.md#real-number-syntax) + - [Disallow ties](/proposals/p000866-allow-ties-in-floating-literals.md) +- [Digit separator syntax](/proposals/p000143-numeric-literals.md#digit-separator-syntax) + - [3-digit decimal groupings](/proposals/p001983-weaken-digit-separator-placement-rules.md#3-digit-decimal-groupings) + - [2-digit or 4-digit hexadecimal digit groupings](/proposals/p001983-weaken-digit-separator-placement-rules.md#2-digit-or-4-digit-hexadecimal-digit-groupings) + - [Disallow digit separators in fractions](/proposals/p001983-weaken-digit-separator-placement-rules.md#disallow-digit-separators-in-fractions) +- [No octal literals](/proposals/p006910-support-octal-literals.md#no-octal-literals) ## References diff --git a/docs/design/lexical_conventions/string_literals.md b/docs/design/lexical_conventions/string_literals.md index 5e07110de1e9..dd376725ea1e 100644 --- a/docs/design/lexical_conventions/string_literals.md +++ b/docs/design/lexical_conventions/string_literals.md @@ -326,18 +326,18 @@ string in the type system. In such string literals, we should consider rejecting ## Alternatives considered -- [Block string literals](/proposals/p0199.md#block-string-literals) - - [Leading whitespace removal](/proposals/p0199.md#leading-whitespace-removal) - - [Terminating newline](/proposals/p0199.md#terminating-newline) -- [Escape sequences](/proposals/p0199.md#escape-sequences-1) +- [Block string literals](/proposals/p000199-string-literals.md#block-string-literals) + - [Leading whitespace removal](/proposals/p000199-string-literals.md#leading-whitespace-removal) + - [Terminating newline](/proposals/p000199-string-literals.md#terminating-newline) +- [Escape sequences](/proposals/p000199-string-literals.md#escape-sequences-1) - Unicode escape sequences: - - [Allow zero digits](/proposals/p2040.md#allow-zero-digits) - - [Allow any number of hexadecimal characters](/proposals/p2040.md#allow-any-number-of-hexadecimal-characters) - - [Limiting to 6 digits versus 8](/proposals/p2040.md#limiting-to-6-digits-versus-8) -- [Raw string literals](/proposals/p0199.md#raw-string-literals-1) - - [Trailing whitespace](/proposals/p0199.md#trailing-whitespace) - - [Line separators](/proposals/p0199.md#line-separators) -- [Internal whitespace](/proposals/p0199.md#internal-whitespace) + - [Allow zero digits](/proposals/p002040-unicode-escape-code-length.md#allow-zero-digits) + - [Allow any number of hexadecimal characters](/proposals/p002040-unicode-escape-code-length.md#allow-any-number-of-hexadecimal-characters) + - [Limiting to 6 digits versus 8](/proposals/p002040-unicode-escape-code-length.md#limiting-to-6-digits-versus-8) +- [Raw string literals](/proposals/p000199-string-literals.md#raw-string-literals-1) + - [Trailing whitespace](/proposals/p000199-string-literals.md#trailing-whitespace) + - [Line separators](/proposals/p000199-string-literals.md#line-separators) +- [Internal whitespace](/proposals/p000199-string-literals.md#internal-whitespace) - [Different restrictions for file type indicators](https://github.com/carbon-language/carbon-lang/issues/2140) ## References diff --git a/docs/design/lexical_conventions/symbolic_tokens.md b/docs/design/lexical_conventions/symbolic_tokens.md index 81b6f447efcb..f1ecf731b2fa 100644 --- a/docs/design/lexical_conventions/symbolic_tokens.md +++ b/docs/design/lexical_conventions/symbolic_tokens.md @@ -101,7 +101,7 @@ source file: ## Alternatives considered -[Alternatives from proposal #601](/proposals/p0601.md#alternatives-considered): +[Alternatives from proposal #601](/proposals/p000601-operator-tokens.md#alternatives-considered): - lex the longest sequence of symbolic characters rather than lexing only the longest known operator diff --git a/docs/design/lexical_conventions/whitespace.md b/docs/design/lexical_conventions/whitespace.md index d4fc48d3101e..86ad1108b213 100644 --- a/docs/design/lexical_conventions/whitespace.md +++ b/docs/design/lexical_conventions/whitespace.md @@ -21,7 +21,7 @@ The exact lexical form of Carbon whitespace has not yet been settled. However, Carbon will follow lexical conventions for whitespace based on [Unicode Annex #31](https://unicode.org/reports/tr31/). TODO: Update this once the precise rules are decided; see the -[Unicode source files](/proposals/p0142.md#characters-in-identifiers-and-whitespace) +[Unicode source files](/proposals/p000142-unicode-source-files.md#characters-in-identifiers-and-whitespace) proposal. Unicode Annex #31 suggests selecting whitespace characters based on the diff --git a/docs/design/lexical_conventions/words.md b/docs/design/lexical_conventions/words.md index ea2d0eff8230..aebf4b98dd60 100644 --- a/docs/design/lexical_conventions/words.md +++ b/docs/design/lexical_conventions/words.md @@ -29,7 +29,7 @@ The exact lexical form of words has not yet been settled. However, Carbon will follow lexical conventions for identifiers based on [Unicode Annex #31](https://unicode.org/reports/tr31/). TODO: Update this once the precise rules are decided; see the -[Unicode source files](/proposals/p0142.md#characters-in-identifiers-and-whitespace) +[Unicode source files](/proposals/p000142-unicode-source-files.md#characters-in-identifiers-and-whitespace) proposal. Carbon source files, including comments and string literals, are required to be @@ -131,22 +131,22 @@ then `word` and `r#word` have the same meaning. Overview: -- [Character encoding: We could restrict words to ASCII.](/proposals/p0142.md#character-encoding-1) -- [Normalization form alternatives considered](/proposals/p0142.md#normalization-forms) +- [Character encoding: We could restrict words to ASCII.](/proposals/p000142-unicode-source-files.md#character-encoding-1) +- [Normalization form alternatives considered](/proposals/p000142-unicode-source-files.md#normalization-forms) Type literals: -- [Use C++ type keywords with LP64 convention](/proposals/p2015.md#c-lp64-convention) -- [Use full type name with length suffix](/proposals/p2015.md#type-name-with-length-suffix) -- [Use uppercase for type names](/proposals/p2015.md#uppercase-suffixes) -- [Support additional bit widths](/proposals/p2015.md#additional-bit-sizes) +- [Use C++ type keywords with LP64 convention](/proposals/p002015-numeric-type-literal-syntax.md#c-lp64-convention) +- [Use full type name with length suffix](/proposals/p002015-numeric-type-literal-syntax.md#type-name-with-length-suffix) +- [Use uppercase for type names](/proposals/p002015-numeric-type-literal-syntax.md#uppercase-suffixes) +- [Support additional bit widths](/proposals/p002015-numeric-type-literal-syntax.md#additional-bit-sizes) Raw identifiers: -- [Other raw identifier syntaxes](/proposals/p3797.md#other-raw-identifier-syntaxes) -- [Restrict raw identifier syntax to current and future keywords](/proposals/p3797.md#restrict-raw-identifier-syntax-to-current-and-future-keywords) -- [Don't require syntax for references to raw identifiers](/proposals/p3797.md#dont-require-syntax-for-references-to-raw-identifiers) -- [Don't provide raw identifier syntax](/proposals/p3797.md#dont-provide-raw-identifier-syntax) +- [Other raw identifier syntaxes](/proposals/p003797-raw-identifier-syntax.md#other-raw-identifier-syntaxes) +- [Restrict raw identifier syntax to current and future keywords](/proposals/p003797-raw-identifier-syntax.md#restrict-raw-identifier-syntax-to-current-and-future-keywords) +- [Don't require syntax for references to raw identifiers](/proposals/p003797-raw-identifier-syntax.md#dont-require-syntax-for-references-to-raw-identifiers) +- [Don't provide raw identifier syntax](/proposals/p003797-raw-identifier-syntax.md#dont-provide-raw-identifier-syntax) ## References diff --git a/docs/design/naming_conventions.md b/docs/design/naming_conventions.md index 3d4d268202e8..16547ebc8caf 100644 --- a/docs/design/naming_conventions.md +++ b/docs/design/naming_conventions.md @@ -95,8 +95,8 @@ will make decisions on future naming. ## Alternatives considered -- [Other naming conventions](/proposals/p0861.md#other-naming-conventions) -- [Other conventions for naming Carbon types](/proposals/p0861.md#other-conventions-for-naming-carbon-types) +- [Other naming conventions](/proposals/p000861-naming-conventions.md#other-naming-conventions) +- [Other conventions for naming Carbon types](/proposals/p000861-naming-conventions.md#other-conventions-for-naming-carbon-types) ## References diff --git a/docs/design/pattern_matching.md b/docs/design/pattern_matching.md index 09f0388b8244..9994bdc09294 100644 --- a/docs/design/pattern_matching.md +++ b/docs/design/pattern_matching.md @@ -123,7 +123,7 @@ would, in the cases where they overlap. #### Alternatives considered -- [Introducer syntax for expression patterns](/proposals/p2188.md#introducer-syntax-for-expression-patterns) +- [Introducer syntax for expression patterns](/proposals/p002188-pattern-matching-syntax-and-semantics.md#introducer-syntax-for-expression-patterns) ### Binding patterns @@ -225,8 +225,10 @@ fn F(n: i32) { } ``` -As specified in [#1084](/proposals/p1084.md), function redeclarations may -replace binding names with `_`s but may not use different names. +As specified in +[#1084](/proposals/p001084-generics-details-9-forward-declarations.md), function +redeclarations may replace binding names with `_`s but may not use different +names. ```carbon fn G(n: i32); @@ -241,11 +243,11 @@ fn H(m: i32) {} ##### Alternatives considered -- [Commented names](/proposals/p2022.md#commented-names) -- [Only short form support with `_`](/proposals/p2022.md#only-short-form-support-with-_) -- [Named identifiers prefixed with `_`](/proposals/p2022.md#named-identifiers-prefixed-with-_) -- [Anonymous, named identifiers](/proposals/p2022.md#anonymous-named-identifiers) -- [Attributes](/proposals/p2022.md#attributes) +- [Commented names](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#commented-names) +- [Only short form support with `_`](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#only-short-form-support-with-_) +- [Named identifiers prefixed with `_`](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#named-identifiers-prefixed-with-_) +- [Anonymous, named identifiers](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#anonymous-named-identifiers) +- [Attributes](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#attributes) #### `auto` and type deduction @@ -290,7 +292,7 @@ specified. #### Alternatives considered -- [Shorthand for `auto`](/proposals/p2188.md#shorthand-for-auto) +- [Shorthand for `auto`](/proposals/p002188-pattern-matching-syntax-and-semantics.md#shorthand-for-auto) ### `var` @@ -328,9 +330,9 @@ _pattern_ `=` _expression_ `;`. #### Alternatives considered -- [Treat all bindings under `var` as variable bindings](/proposals/p5164.md#treat-all-bindings-under-var-as-variable-bindings) -- [Make `var` a binding pattern modifier](/proposals/p5164.md#make-var-a-binding-pattern-modifier) -- [Initialize storage once pattern matching succeeds](/proposals/p5164.md#initialize-storage-once-pattern-matching-succeeds) +- [Treat all bindings under `var` as variable bindings](/proposals/p005164-updates-to-pattern-matching-for-objects.md#treat-all-bindings-under-var-as-variable-bindings) +- [Make `var` a binding pattern modifier](/proposals/p005164-updates-to-pattern-matching-for-objects.md#make-var-a-binding-pattern-modifier) +- [Initialize storage once pattern matching succeeds](/proposals/p005164-updates-to-pattern-matching-for-objects.md#initialize-storage-once-pattern-matching-succeeds) ### `unused` @@ -350,10 +352,10 @@ bindings in a pattern. Nesting `unused` markers is an error. When an `unused` marker applies only to anonymous bindings `_` and is thus redundant, a warning is produced. `var` and `unused` may appear in any order in a pattern. -As specified in [#3763](/proposals/p3763.md), `unused` markers may only appear -on definitions, not on non-defining declarations. Function redeclarations that -are also definitions may have difference due to `unused` markers, but they may -not have different names. +As specified in [#3763](/proposals/p003763-matching-redeclarations.md), `unused` +markers may only appear on definitions, not on non-defining declarations. +Function redeclarations that are also definitions may have difference due to +`unused` markers, but they may not have different names. ```carbon fn J(n: i32); @@ -444,7 +446,7 @@ This is valid even if all fields are actually named in the pattern. #### Alternatives considered -- [Struct pattern syntax](/proposals/p2188.md#struct-pattern-syntax) +- [Struct pattern syntax](/proposals/p002188-pattern-matching-syntax-and-semantics.md#struct-pattern-syntax) ### Alternative patterns @@ -677,8 +679,8 @@ We will diagnose the following situations: #### Alternatives considered -- [Treat expression patterns as exhaustive if they cover all possible values](/proposals/p2188.md#treat-expression-patterns-as-exhaustive-if-they-cover-all-possible-values) -- [Allow non-exhaustive `match` statements](/proposals/p2188.md#allow-non-exhaustive-match-statements) +- [Treat expression patterns as exhaustive if they cover all possible values](/proposals/p002188-pattern-matching-syntax-and-semantics.md#treat-expression-patterns-as-exhaustive-if-they-cover-all-possible-values) +- [Allow non-exhaustive `match` statements](/proposals/p002188-pattern-matching-syntax-and-semantics.md#allow-non-exhaustive-match-statements) ## Pattern usage @@ -768,7 +770,7 @@ fn F(x: X) { #### Alternatives considered -- [Allow variable binding patterns to alias across `case`s](/proposals/p5164.md#allow-variable-binding-patterns-to-alias-across-cases) +- [Allow variable binding patterns to alias across `case`s](/proposals/p005164-updates-to-pattern-matching-for-objects.md#allow-variable-binding-patterns-to-alias-across-cases) #### Guards @@ -928,8 +930,8 @@ evaluation order will be evaluated. ### Alternatives considered -- [Breadth-first evaluation order](/proposals/p5545.md#breadth-first-evaluation-order) -- [Depth-first evaluation with a different "horizontal" order](/proposals/p5545.md#depth-first-evaluation-with-a-different-horizontal-order) +- [Breadth-first evaluation order](/proposals/p005545-expression-form-basics.md#breadth-first-evaluation-order) +- [Depth-first evaluation with a different "horizontal" order](/proposals/p005545-expression-form-basics.md#depth-first-evaluation-with-a-different-horizontal-order) ## Open questions @@ -945,8 +947,8 @@ pattern matching machinery, what (if any) restrictions are imposed, etc. ## Alternatives considered -- [Type pattern matching](/proposals/p2188.md#type-pattern-matching) -- [Allow guards on arbitrary patterns](/proposals/p2188.md#allow-guards-on-arbitrary-patterns) +- [Type pattern matching](/proposals/p002188-pattern-matching-syntax-and-semantics.md#type-pattern-matching) +- [Allow guards on arbitrary patterns](/proposals/p002188-pattern-matching-syntax-and-semantics.md#allow-guards-on-arbitrary-patterns) ## References diff --git a/docs/design/sum_types.md b/docs/design/sum_types.md index 6eae17f5ca74..92f07e2bc9ac 100644 --- a/docs/design/sum_types.md +++ b/docs/design/sum_types.md @@ -228,15 +228,15 @@ return an index that identifies the `case` body to be executed. ## Alternatives considered -- [Providing `choice` types only](/proposals/p0157.md#choice-types-only), with - no support for user-defined sum types. -- [Indexing alternatives by type](/proposals/p0157.md#indexing-by-type) +- [Providing `choice` types only](/proposals/p000157-design-direction-for-sum-types.md#choice-types-only), + with no support for user-defined sum types. +- [Indexing alternatives by type](/proposals/p000157-design-direction-for-sum-types.md#indexing-by-type) instead of by name. - Implementing user-defined sum types in terms of - [`choice` type proxies](/proposals/p0157.md#pattern-matching-proxies) rather - than callbacks. + [`choice` type proxies](/proposals/p000157-design-direction-for-sum-types.md#pattern-matching-proxies) + rather than callbacks. - Implementing user-defined sum types in terms of invertible - [pattern functions](/proposals/p0157.md#pattern-functions). + [pattern functions](/proposals/p000157-design-direction-for-sum-types.md#pattern-functions). ## References diff --git a/docs/design/tuples.md b/docs/design/tuples.md index ee3f31cb474c..d36f331947a4 100644 --- a/docs/design/tuples.md +++ b/docs/design/tuples.md @@ -174,10 +174,10 @@ answer here: ## Alternatives considered -- [Indexing with square brackets](/proposals/p3646.md#square-bracket-notation) -- [Indexing from the end of a tuple](/proposals/p3646.md#negative-indexing-from-the-end-of-the-tuple) -- [Restrict indexes to decimal integers](/proposals/p3646.md#decimal-indexing-restriction) -- [Alternatives to trailing commas](/proposals/p3646.md#trailing-commas) +- [Indexing with square brackets](/proposals/p003646-tuples-and-tuple-indexing.md#square-bracket-notation) +- [Indexing from the end of a tuple](/proposals/p003646-tuples-and-tuple-indexing.md#negative-indexing-from-the-end-of-the-tuple) +- [Restrict indexes to decimal integers](/proposals/p003646-tuples-and-tuple-indexing.md#decimal-indexing-restriction) +- [Alternatives to trailing commas](/proposals/p003646-tuples-and-tuple-indexing.md#trailing-commas) ## References diff --git a/docs/design/type_inference.md b/docs/design/type_inference.md index a8be98beb3d0..b9c0a50cdf0f 100644 --- a/docs/design/type_inference.md +++ b/docs/design/type_inference.md @@ -48,7 +48,7 @@ return types. ## Alternatives considered -- [Use `_` instead of `auto`](/proposals/p0851.md#use-_-instead-of-auto) +- [Use `_` instead of `auto`](/proposals/p000851-variable-type-inference.md#use-_-instead-of-auto) ## References diff --git a/docs/design/values.md b/docs/design/values.md index 0186e7e5357d..4aaf57a2b70f 100644 --- a/docs/design/values.md +++ b/docs/design/values.md @@ -597,7 +597,7 @@ fn F(s_value: S) { ``` The specific tradeoff here is covered in a proposal -[alternative](/proposals/p2006.md#value-expression-escape-hatches). +[alternative](/proposals/p002006-values-variables-pointers-and-references.md#value-expression-escape-hatches). ## Initializing expressions @@ -727,10 +727,11 @@ proper. #### Deferred initialization from values and references TODO: This section needs to be updated to reflect the addition of `-> val` -returns in [proposal #5434](/proposals/p5434.md). This section could be replaced -by a statement that initializing returns may be replaced by value returns when -that is safe and correct, moving much of this content into a description of how -value returns works. +returns in +[proposal #5434](/proposals/p005434-ref-parameters-arguments-returns-and-val-returns.md). +This section could be replaced by a statement that initializing returns may be +replaced by value returns when that is safe and correct, moving much of this +content into a description of how value returns works. Carbon also makes the evaluation of function calls and return statements tightly linked in order to enable more efficiency improvements. It allows the actual @@ -1107,7 +1108,7 @@ specialized constructs given the specialized nature of these operations. ### Reference types TODO: This section needs to be updated to reflect -[proposal #5434](/proposals/p5434.md). +[proposal #5434](/proposals/p005434-ref-parameters-arguments-returns-and-val-returns.md). Unlike C++, Carbon does not currently have reference types. The only form of indirect access are pointers. There are a few aspects to this decision that need @@ -1136,9 +1137,9 @@ distinction between indirect access and direct access. For a full discussion of the tradeoffs of these design decisions, see the alternatives considered section of [P2006]: -- [References in addition to pointers](/proposals/p2006.md#references-in-addition-to-pointers) -- [Syntax-free or automatic dereferencing](/proposals/p2006.md#syntax-free-or-automatic-dereferencing) -- [Exclusively using references](/proposals/p2006.md#exclusively-using-references) +- [References in addition to pointers](/proposals/p002006-values-variables-pointers-and-references.md#references-in-addition-to-pointers) +- [Syntax-free or automatic dereferencing](/proposals/p002006-values-variables-pointers-and-references.md#syntax-free-or-automatic-dereferencing) +- [Exclusively using references](/proposals/p002006-values-variables-pointers-and-references.md#exclusively-using-references) ### Pointer syntax @@ -1159,7 +1160,7 @@ pointer types as they are commonly written in code and are expected to be extremely common and a key anchor of syntactic similarity between the languages. The different alternatives and tradeoffs for this syntax issue were discussed extensively in [#523] and are summarized in the -[proposal](/proposals/p2006.md#alternative-pointer-syntaxes). +[proposal](/proposals/p002006-values-variables-pointers-and-references.md#alternative-pointer-syntaxes). [#523]: https://github.com/carbon-language/carbon-lang/issues/523 @@ -1486,33 +1487,33 @@ itself. ## Alternatives considered -- [No `var` introducer keyword](/proposals/p0339.md#no-var-introducer-keyword) -- [Name of the `var` statement introducer](/proposals/p0339.md#name-of-the-var-statement-introducer) -- [Colon between type and identifier](/proposals/p0339.md#colon-between-type-and-identifier) -- [Type elision](/proposals/p0339.md#type-elision) -- [Type ordering](/proposals/p0618.md#type-ordering) -- [Elide the type instead of using `auto`](/proposals/p0851.md#elide-the-type-instead-of-using-auto) -- [Value expression escape hatches](/proposals/p2006.md#value-expression-escape-hatches) -- [References in addition to pointers](/proposals/p2006.md#references-in-addition-to-pointers) -- [Syntax-free or automatic dereferencing](/proposals/p2006.md#syntax-free-or-automatic-dereferencing) -- [Exclusively using references](/proposals/p2006.md#exclusively-using-references) -- [Alternative pointer syntaxes](/proposals/p2006.md#alternative-pointer-syntaxes) -- [Alternative syntaxes for locals](/proposals/p2006.md#alternative-syntaxes-for-locals) -- [Mixed expression categories](/proposals/p5545.md#mixed-expression-categories) -- [Don't implicitly convert to less-primitive forms](/proposals/p5545.md#dont-implicitly-convert-to-less-primitive-forms) +- [No `var` introducer keyword](/proposals/p000339-var-statement.md#no-var-introducer-keyword) +- [Name of the `var` statement introducer](/proposals/p000339-var-statement.md#name-of-the-var-statement-introducer) +- [Colon between type and identifier](/proposals/p000339-var-statement.md#colon-between-type-and-identifier) +- [Type elision](/proposals/p000339-var-statement.md#type-elision) +- [Type ordering](/proposals/p000618-var-ordering.md#type-ordering) +- [Elide the type instead of using `auto`](/proposals/p000851-variable-type-inference.md#elide-the-type-instead-of-using-auto) +- [Value expression escape hatches](/proposals/p002006-values-variables-pointers-and-references.md#value-expression-escape-hatches) +- [References in addition to pointers](/proposals/p002006-values-variables-pointers-and-references.md#references-in-addition-to-pointers) +- [Syntax-free or automatic dereferencing](/proposals/p002006-values-variables-pointers-and-references.md#syntax-free-or-automatic-dereferencing) +- [Exclusively using references](/proposals/p002006-values-variables-pointers-and-references.md#exclusively-using-references) +- [Alternative pointer syntaxes](/proposals/p002006-values-variables-pointers-and-references.md#alternative-pointer-syntaxes) +- [Alternative syntaxes for locals](/proposals/p002006-values-variables-pointers-and-references.md#alternative-syntaxes-for-locals) +- [Mixed expression categories](/proposals/p005545-expression-form-basics.md#mixed-expression-categories) +- [Don't implicitly convert to less-primitive forms](/proposals/p005545-expression-form-basics.md#dont-implicitly-convert-to-less-primitive-forms) ## References -- [Proposal #257: Initialization of memory and values][p0257] -- [Proposal #339: `var` statement][p0339] -- [Proposal #618: `var` ordering][p0618] -- [Proposal #851: auto keyword for vars][p0851] -- [Proposal #2006: Values, variables, and pointers][p2006] -- [Proposal #5545: Expression form basics][p5545] +- [Proposal #257: Initialization of memory and values][#257] +- [Proposal #339: `var` statement][#339] +- [Proposal #618: `var` ordering][#618] +- [Proposal #851: auto keyword for vars][#851] +- [Proposal #2006: Values, variables, and pointers][#2006] +- [Proposal #5545: Expression form basics][#5545] -[p0257]: /proposals/p0257.md -[p0339]: /proposals/p0339.md -[p0618]: /proposals/p0618.md -[p0851]: /proposals/p0851.md -[p2006]: /proposals/p2006.md -[p5545]: /proposals/p5545.md +[#257]: /proposals/p000257-initialization-of-memory-and-variables.md +[#339]: /proposals/p000339-var-statement.md +[#618]: /proposals/p000618-var-ordering.md +[#851]: /proposals/p000851-variable-type-inference.md +[#2006]: /proposals/p002006-values-variables-pointers-and-references.md +[#5545]: /proposals/p005545-expression-form-basics.md diff --git a/docs/design/variadics.md b/docs/design/variadics.md index ee1e949067f2..2cd52325e4a2 100644 --- a/docs/design/variadics.md +++ b/docs/design/variadics.md @@ -921,25 +921,25 @@ any further merging, so this must be the canonical form. ## Alternatives considered -- [Member packs](/proposals/p2240.md#member-packs) -- [Single semantic model for pack expansions](/proposals/p2240.md#single-semantic-model-for-pack-expansions) -- [Generalize `expand`](/proposals/p2240.md#generalize-expand) -- [Omit `expand`](/proposals/p2240.md#omit-expand) -- [Support expanding arrays](/proposals/p2240.md#support-expanding-arrays) -- [Omit each-names](/proposals/p2240.md#omit-each-names) - - [Disallow pack-type bindings](/proposals/p2240.md#disallow-pack-type-bindings) -- [Fold expressions](/proposals/p2240.md#fold-expressions) -- [Allow multiple pack expansions in a tuple pattern](/proposals/p2240.md#allow-multiple-pack-expansions-in-a-tuple-pattern) -- [Allow nested pack expansions](/proposals/p2240.md#allow-nested-pack-expansions) -- [Use postfix instead of prefix `...`](/proposals/p2240.md#use-postfix-instead-of-prefix-) -- [Avoid context-sensitity in pack expansions](/proposals/p2240.md#avoid-context-sensitity-in-pack-expansions) - - [Fold-like syntax](/proposals/p2240.md#fold-like-syntax) - - [Variadic blocks](/proposals/p2240.md#variadic-blocks) - - [Keyword syntax](/proposals/p2240.md#keyword-syntax) -- [Require parentheses around `each`](/proposals/p2240.md#require-parentheses-around-each) -- [Fused expansion tokens](/proposals/p2240.md#fused-expansion-tokens) -- [No parameter merging](/proposals/p2240.md#no-parameter-merging) -- [Exhaustive function call typechecking](/proposals/p2240.md#exhaustive-function-call-typechecking) +- [Member packs](/proposals/p002240-variadics.md#member-packs) +- [Single semantic model for pack expansions](/proposals/p002240-variadics.md#single-semantic-model-for-pack-expansions) +- [Generalize `expand`](/proposals/p002240-variadics.md#generalize-expand) +- [Omit `expand`](/proposals/p002240-variadics.md#omit-expand) +- [Support expanding arrays](/proposals/p002240-variadics.md#support-expanding-arrays) +- [Omit each-names](/proposals/p002240-variadics.md#omit-each-names) + - [Disallow pack-type bindings](/proposals/p002240-variadics.md#disallow-pack-type-bindings) +- [Fold expressions](/proposals/p002240-variadics.md#fold-expressions) +- [Allow multiple pack expansions in a tuple pattern](/proposals/p002240-variadics.md#allow-multiple-pack-expansions-in-a-tuple-pattern) +- [Allow nested pack expansions](/proposals/p002240-variadics.md#allow-nested-pack-expansions) +- [Use postfix instead of prefix `...`](/proposals/p002240-variadics.md#use-postfix-instead-of-prefix-) +- [Avoid context-sensitity in pack expansions](/proposals/p002240-variadics.md#avoid-context-sensitity-in-pack-expansions) + - [Fold-like syntax](/proposals/p002240-variadics.md#fold-like-syntax) + - [Variadic blocks](/proposals/p002240-variadics.md#variadic-blocks) + - [Keyword syntax](/proposals/p002240-variadics.md#keyword-syntax) +- [Require parentheses around `each`](/proposals/p002240-variadics.md#require-parentheses-around-each) +- [Fused expansion tokens](/proposals/p002240-variadics.md#fused-expansion-tokens) +- [No parameter merging](/proposals/p002240-variadics.md#no-parameter-merging) +- [Exhaustive function call typechecking](/proposals/p002240-variadics.md#exhaustive-function-call-typechecking) ## References diff --git a/docs/project/design_style_guide.md b/docs/project/design_style_guide.md index 90ee4e46e4bf..41ab80d1893e 100644 --- a/docs/project/design_style_guide.md +++ b/docs/project/design_style_guide.md @@ -42,7 +42,7 @@ documentation. - Links to specific sections of a proposal should link to the repository copy of the proposal file, using the section title or other appropriate link text. For example, - `[Painting details](/proposals/p0123.md#painting-details)` + `[Painting details](/proposals/p000123-bikeshed-design.md#painting-details)` ## Document structure @@ -75,7 +75,7 @@ that were considered, along with references to the proposals in which those designs were discussed. For example: ```md -- [Paint widgets from bottom to top](/proposals/p0123.md#alternatives-considered). +- [Paint widgets from bottom to top](/proposals/p000123-bikeshed-design.md#alternatives-considered). ``` ### References diff --git a/docs/project/evolution.md b/docs/project/evolution.md index d1f733dcd801..75c4a43d265b 100644 --- a/docs/project/evolution.md +++ b/docs/project/evolution.md @@ -165,7 +165,6 @@ issues for longer discussion: - When you both have [approval](/docs/project/code_review.md#approving-the-change) from the assigned lead and the last blocking issue is addressed, merge! - - If you end up making significant changes when incorporating resolved issues after the approval from the assigned lead, circle back for a fresh approval before merging, just like you would with code review. @@ -201,7 +200,6 @@ issues for longer discussion: - If there is an open question or a critical blocking issue that needs to get resolved, move it to its own issue that the PR depends on, and focus the discussion there. - - The issue should focus on surfacing the important aspects of the tradeoff represented by the issue or open question, not on advocacy. @@ -276,8 +274,11 @@ edit both as necessary to ensure they give the best high-level understanding of the proposal possible. A proposal PR will include a "P-numbered" _proposal document_, -`proposals/pNNNN.md`, where `NNNN` is the pull request number. This file should -be based on the [proposal template file](/proposals/scripts/template.md). +`proposals/p######-slug.md`, where `######` is the pull request number (padded +to 6 digits) and `slug` is a robust +["slug"-compatible](https://en.wikipedia.org/wiki/Clean_URL#Slug) version of the +title. This file should be based on the +[proposal template file](/proposals/scripts/template.md). When writing a proposal, try to keep it brief and focused to maximize the community's engagement in it. Beyond the above structure, try to use @@ -326,7 +327,7 @@ date, and can easily find out what has changed. For example: ```md > **TODO:** Document the redeclaration syntax `impl C.(as I)` adopted in -> [p5366](/proposals/p5366.md). +> [#5366](/proposals/p005366-the-name-of-an-impl-in-class-scope.md). ``` See the `docs/design` changes in diff --git a/docs/project/faq.md b/docs/project/faq.md index b10470105ef9..5385b85f6439 100644 --- a/docs/project/faq.md +++ b/docs/project/faq.md @@ -333,8 +333,9 @@ But deduced parameters aren't the same thing as template parameters. In particular, deduced parameters are never mentioned at the callsite, so those square brackets are never part of the expression syntax. -See [Proposal #676: `:!` generic syntax](/proposals/p0676.md) for more -background on how and why we chose our current compile-time parameter syntax. +See [Proposal #676: `:!` generic syntax](/proposals/p000676-generic-syntax.md) +for more background on how and why we chose our current compile-time parameter +syntax. ### Why do variable declarations have to start with `var` or `let`? @@ -386,8 +387,8 @@ match `42` with the value of the expression `the_answer`, which requires a variable named `the_answer` to already exist. The pattern matching proposal details alternative -[shorthand for `auto`](/proposals/p2188.md#shorthand-for-auto) and the tradeoffs -that were considered. +[shorthand for `auto`](/proposals/p002188-pattern-matching-syntax-and-semantics.md#shorthand-for-auto) +and the tradeoffs that were considered. References: diff --git a/docs/project/principles/information_accumulation.md b/docs/project/principles/information_accumulation.md index c43023e26f6c..a3b8b3e7fc63 100644 --- a/docs/project/principles/information_accumulation.md +++ b/docs/project/principles/information_accumulation.md @@ -96,8 +96,9 @@ enclosing class, like in C++. ## Alternatives considered - Allow information to be used before it is provided - [globally](/proposals/p0875.md#strict-global-consistency), - [within a file](/proposals/p0875.md#context-sensitive-local-consistency), or - [within a top-level declaration](/proposals/p0875.md#top-down-with-minimally-deferred-type-checking). -- [Do not allow inline method bodies to use members before they are declared](/proposals/p0875.md#strict-top-down) -- [Do not allow separate declaration and definition](/proposals/p0875.md#disallow-separate-declaration-and-definition) + [globally](/proposals/p000875-principle-information-accumulation.md#strict-global-consistency), + [within a file](/proposals/p000875-principle-information-accumulation.md#context-sensitive-local-consistency), + or + [within a top-level declaration](/proposals/p000875-principle-information-accumulation.md#top-down-with-minimally-deferred-type-checking). +- [Do not allow inline method bodies to use members before they are declared](/proposals/p000875-principle-information-accumulation.md#strict-top-down) +- [Do not allow separate declaration and definition](/proposals/p000875-principle-information-accumulation.md#disallow-separate-declaration-and-definition) diff --git a/docs/project/principles/library_apis_only.md b/docs/project/principles/library_apis_only.md index b73233375f44..9a9de0810503 100644 --- a/docs/project/principles/library_apis_only.md +++ b/docs/project/principles/library_apis_only.md @@ -97,4 +97,4 @@ class definitions. ## Alternatives considered -- [Built-in primitive types](/proposals/p1280.md#built-in-primitive-types) +- [Built-in primitive types](/proposals/p001280-principle-all-apis-are-library-apis.md#built-in-primitive-types) diff --git a/docs/project/principles/low_context_sensitivity.md b/docs/project/principles/low_context_sensitivity.md index 0795ea96b50f..7717b454a6a3 100644 --- a/docs/project/principles/low_context_sensitivity.md +++ b/docs/project/principles/low_context_sensitivity.md @@ -153,13 +153,13 @@ in Carbon that reflect applications of this principle: - Carbon doesn't provide an analogy to C++'s [`using namespace`](https://en.cppreference.com/w/cpp/language/namespace#Using-directives) or a - ["wildcard imports" mechanisms](/proposals/p0107.md#broader-imports-either-all-names-or-arbitrary-code) + ["wildcard imports" mechanisms](/proposals/p000107-code-and-name-organization.md#broader-imports-either-all-names-or-arbitrary-code) that merge the names from one namespace into another. Either would introduce ambiguity in where a name is coming from, making the code more context-sensitive. - Carbon doesn't support large blocks of code - [inside a namespace declaration](/proposals/p0107.md#scoped-namespaces), + [inside a namespace declaration](/proposals/p000107-code-and-name-organization.md#scoped-namespaces), where the reader would have to search for the beginning of the block to see what namespace applies. diff --git a/docs/project/principles/namespace_cleanliness.md b/docs/project/principles/namespace_cleanliness.md index f40616b13483..7ca1a31044bb 100644 --- a/docs/project/principles/namespace_cleanliness.md +++ b/docs/project/principles/namespace_cleanliness.md @@ -118,5 +118,5 @@ avoid collisions between the package name `Cpp` and a top-level entity named ## Alternatives considered -- [Have both predeclared identifiers and keywords](/proposals/p4864.md#have-both-predeclared-identifiers-and-keywords) -- [Reserve words with a certain spelling](/proposals/p4864.md#reserve-words-with-a-certain-spelling) +- [Have both predeclared identifiers and keywords](/proposals/p004864-no-predeclared-identifiers-core-is-a-keyword.md#have-both-predeclared-identifiers-and-keywords) +- [Reserve words with a certain spelling](/proposals/p004864-no-predeclared-identifiers-core-is-a-keyword.md#reserve-words-with-a-certain-spelling) diff --git a/docs/project/principles/one_way.md b/docs/project/principles/one_way.md index addf2880eb83..9869467f2454 100644 --- a/docs/project/principles/one_way.md +++ b/docs/project/principles/one_way.md @@ -82,18 +82,19 @@ motivation: - Where C++ allows logical operators to be written with either symbols (for example, `&&`) or text (for example, `and`), Carbon will only support one - form (in this case, [text](/proposals/p0680.md)). + form (in this case, [text](/proposals/p000680-and-or-not.md)). - Where C++ allows hexadecimal numeric literals to be either lowercase (`0xaa`) or uppercase (`0xAA`), and with `x` optionally uppercase as well, - Carbon will only allow the [`0xAA` casing](/proposals/p0143.md). + Carbon will only allow the + [`0xAA` casing](/proposals/p000143-numeric-literals.md). - Where C++ provides both `struct` and `class` with the only difference is access control defaults, Carbon will only provide one (`class`, albeit with default public visibility diverging from C++). However, sometimes language tools are the primary motivation. For example, where C++ allows braces to be omitted for single-statement control flow blocks, Carbon -will [require braces](/proposals/p0623.md). This offers a syntax simplification -that should allow for better error detection. +will [require braces](/proposals/p000623-require-braces.md). This offers a +syntax simplification that should allow for better error detection. ## Caveats @@ -152,4 +153,4 @@ overlapping features without a plan to remove the corresponding legacy version. ## Alternatives considered -- [Provide multiple ways of doing a given thing](/proposals/p0829.md#provide-multiple-ways-of-doing-a-given-thing) +- [Provide multiple ways of doing a given thing](/proposals/p000829-one-way-principle.md#provide-multiple-ways-of-doing-a-given-thing) diff --git a/docs/project/versioning.md b/docs/project/versioning.md index 3558c26a89fc..bc328180706f 100644 --- a/docs/project/versioning.md +++ b/docs/project/versioning.md @@ -267,4 +267,4 @@ and minimizing cache impact. ## Relevant proposal -- [Proposal p4105](/proposals/p4105.md) +- [Proposal #4105](/proposals/p004105-establish-toolchain-and-language-versioning.md) diff --git a/proposals/README.md b/proposals/README.md index 79524759a002..4cc5a0106438 100644 --- a/proposals/README.md +++ b/proposals/README.md @@ -17,9 +17,10 @@ This directory contains accepted proposals for the carbon-lang repository. For information about declined/deferred proposals, please view the proposal's original pull request. -For accepted proposals, where `####` is the corresponding proposal's pull -request: +For accepted proposals, where `######` is the corresponding proposal's pull +request number (padded to 6 digits): -- `p####.md` will contain the main proposal text. -- `p####` may be present as an optional subdirectory for related files (for - example, images). +- `p######-slug.md` will contain the main proposal text, where `slug` is a + robust slugification of the title of the proposal. +- `p######-slug` may be present as an optional subdirectory for related files + (for example, images). diff --git a/proposals/p0024.md b/proposals/p000024-generics-goals.md similarity index 100% rename from proposals/p0024.md rename to proposals/p000024-generics-goals.md diff --git a/proposals/p0029.md b/proposals/p000029-linear-rebase-and-pull-request-github-workflow.md similarity index 100% rename from proposals/p0029.md rename to proposals/p000029-linear-rebase-and-pull-request-github-workflow.md diff --git a/proposals/p0042.md b/proposals/p000042-create-code-review-guidelines.md similarity index 100% rename from proposals/p0042.md rename to proposals/p000042-create-code-review-guidelines.md diff --git a/proposals/p0044.md b/proposals/p000044-proposal-tracking.md similarity index 100% rename from proposals/p0044.md rename to proposals/p000044-proposal-tracking.md diff --git a/proposals/p0051.md b/proposals/p000051-goals.md similarity index 100% rename from proposals/p0051.md rename to proposals/p000051-goals.md diff --git a/proposals/p0063.md b/proposals/p000063-criteria-for-carbon-to-go-public.md similarity index 100% rename from proposals/p0063.md rename to proposals/p000063-criteria-for-carbon-to-go-public.md diff --git a/proposals/p0074.md b/proposals/p000074-change-comment-decision-timelines-in-proposal-process.md similarity index 100% rename from proposals/p0074.md rename to proposals/p000074-change-comment-decision-timelines-in-proposal-process.md diff --git a/proposals/p0083.md b/proposals/p000083-in-progress-design-overview.md similarity index 100% rename from proposals/p0083.md rename to proposals/p000083-in-progress-design-overview.md diff --git a/proposals/p0107.md b/proposals/p000107-code-and-name-organization.md similarity index 100% rename from proposals/p0107.md rename to proposals/p000107-code-and-name-organization.md diff --git a/proposals/p0113.md b/proposals/p000113-add-a-c-style-guide.md similarity index 100% rename from proposals/p0113.md rename to proposals/p000113-add-a-c-style-guide.md diff --git a/proposals/p0120.md b/proposals/p000120-add-idiomatic-code-performance-and-developer-facing-docs-to-goals.md similarity index 100% rename from proposals/p0120.md rename to proposals/p000120-add-idiomatic-code-performance-and-developer-facing-docs-to-goals.md diff --git a/proposals/p0140.md b/proposals/p000140-create-initial-rough-framework-for-specification.md similarity index 100% rename from proposals/p0140.md rename to proposals/p000140-create-initial-rough-framework-for-specification.md diff --git a/proposals/p0142.md b/proposals/p000142-unicode-source-files.md similarity index 100% rename from proposals/p0142.md rename to proposals/p000142-unicode-source-files.md diff --git a/proposals/p0143.md b/proposals/p000143-numeric-literals.md similarity index 100% rename from proposals/p0143.md rename to proposals/p000143-numeric-literals.md diff --git a/proposals/p0144.md b/proposals/p000144-numeric-literal-semantics.md similarity index 100% rename from proposals/p0144.md rename to proposals/p000144-numeric-literal-semantics.md diff --git a/proposals/p0149.md b/proposals/p000149-change-documentation-style-guide.md similarity index 100% rename from proposals/p0149.md rename to proposals/p000149-change-documentation-style-guide.md diff --git a/proposals/p0157.md b/proposals/p000157-design-direction-for-sum-types.md similarity index 99% rename from proposals/p0157.md rename to proposals/p000157-design-direction-for-sum-types.md index db088bea0209..24cef13370ea 100644 --- a/proposals/p0157.md +++ b/proposals/p000157-design-direction-for-sum-types.md @@ -229,8 +229,9 @@ supply the missing functionality identified above. These features are largely separable, although there are some dependencies between them, so their detailed design will be addressed in future proposals, and the details discussed here should be considered provisional. This proposal merely establishes the overall -design direction for sum types, in the same way that [#83](p0083.md) established -the overall design direction for the language as a whole. +design direction for sum types, in the same way that +[#83](p000083-in-progress-design-overview.md) established the overall design +direction for the language as a whole. To support manual lifetime control and storage sharing, I propose introducing at least one and preferably both of the following: @@ -1012,7 +1013,7 @@ This ensures that a sum type's API is defined using essentially the same syntax, regardless of how the type author chooses to implement it. This approach is described in much more detail in an -[earlier draft](https://github.com/carbon-language/carbon-lang/blob/4dbd31d71e02895892f97a211df4b5fff8cae5c3/proposals/p0157.md) +[earlier draft](https://github.com/carbon-language/carbon-lang/blob/4dbd31d71e02895892f97a211df4b5fff8cae5c3/proposals/p000157-design-direction-for-sum-types.md) of this document, where it was the primary proposal. It has a number of advantages over the primary proposal: diff --git a/proposals/p0162.md b/proposals/p000162-basic-syntax.md similarity index 98% rename from proposals/p0162.md rename to proposals/p000162-basic-syntax.md index 3d193d1b8d42..eada1f519389 100644 --- a/proposals/p0162.md +++ b/proposals/p000162-basic-syntax.md @@ -528,11 +528,11 @@ proposal stage, which will help us avoid wasting time and effort implementing designs that turn out to be unworkable. This can be considered as sort of a counterpart to -[In-progress design overview #83](p0083.md), in that the design specifics are -being approved in order to bootstrap the specification process. We aren't -necessarily adopting the specific syntax and semantics expressed by this -proposal, and those choices will need to be presented and justified from scratch -by future proposals. +[In-progress design overview #83](p000083-in-progress-design-overview.md), in +that the design specifics are being approved in order to bootstrap the +specification process. We aren't necessarily adopting the specific syntax and +semantics expressed by this proposal, and those choices will need to be +presented and justified from scratch by future proposals. This decision is deferring the implementation to code review. The specific tooling used to implement the syntax checker, such as Bison, is a detail which diff --git a/proposals/p0175.md b/proposals/p000175-c-interoperability-goals.md similarity index 100% rename from proposals/p0175.md rename to proposals/p000175-c-interoperability-goals.md diff --git a/proposals/p0179.md b/proposals/p000179-create-a-toolchain-team.md similarity index 100% rename from proposals/p0179.md rename to proposals/p000179-create-a-toolchain-team.md diff --git a/proposals/p0196.md b/proposals/p000196-language-level-safety-strategy.md similarity index 100% rename from proposals/p0196.md rename to proposals/p000196-language-level-safety-strategy.md diff --git a/proposals/p0198.md b/proposals/p000198-comments.md similarity index 100% rename from proposals/p0198.md rename to proposals/p000198-comments.md diff --git a/proposals/p0199.md b/proposals/p000199-string-literals.md similarity index 100% rename from proposals/p0199.md rename to proposals/p000199-string-literals.md diff --git a/proposals/p0253.md b/proposals/p000253-2021-roadmap.md similarity index 100% rename from proposals/p0253.md rename to proposals/p000253-2021-roadmap.md diff --git a/proposals/p0257.md b/proposals/p000257-initialization-of-memory-and-variables.md similarity index 100% rename from proposals/p0257.md rename to proposals/p000257-initialization-of-memory-and-variables.md diff --git a/proposals/p0285.md b/proposals/p000285-if-else.md similarity index 100% rename from proposals/p0285.md rename to proposals/p000285-if-else.md diff --git a/proposals/p0301.md b/proposals/p000301-principle-errors-are-values.md similarity index 100% rename from proposals/p0301.md rename to proposals/p000301-principle-errors-are-values.md diff --git a/proposals/p0339.md b/proposals/p000339-var-statement.md similarity index 99% rename from proposals/p0339.md rename to proposals/p000339-var-statement.md index 70cdbd95d924..dfa36857adc8 100644 --- a/proposals/p0339.md +++ b/proposals/p000339-var-statement.md @@ -221,8 +221,8 @@ something like `let mut` in Rust. However, this is not assumed by this proposal: appropriately [focuses on encouraging appropriate usage of features rather than restricting misuse](/docs/project/goals.md#code-that-is-easy-to-read-understand-and-write)). - Lower verbosity syntax for variables is more - [consistent with C++](p0285.md#c-as-baseline), even if constants are made - less verbose by way of `let`. + [consistent with C++](p000285-if-else.md#c-as-baseline), even if constants + are made less verbose by way of `let`. ### Multiple identifiers in one statement diff --git a/proposals/p0340.md b/proposals/p000340-while-loops.md similarity index 100% rename from proposals/p0340.md rename to proposals/p000340-while-loops.md diff --git a/proposals/p0353.md b/proposals/p000353-for-loops.md similarity index 100% rename from proposals/p0353.md rename to proposals/p000353-for-loops.md diff --git a/proposals/p0415.md b/proposals/p000415-syntax-return.md similarity index 100% rename from proposals/p0415.md rename to proposals/p000415-syntax-return.md diff --git a/proposals/p0426.md b/proposals/p000426-governance-evolution-revamp.md similarity index 100% rename from proposals/p0426.md rename to proposals/p000426-governance-evolution-revamp.md diff --git a/proposals/p0438.md b/proposals/p000438-functions.md similarity index 100% rename from proposals/p0438.md rename to proposals/p000438-functions.md diff --git a/proposals/p0444.md b/proposals/p000444-github-discussions.md similarity index 100% rename from proposals/p0444.md rename to proposals/p000444-github-discussions.md diff --git a/proposals/p0447.md b/proposals/p000447-generics-terminology.md similarity index 100% rename from proposals/p0447.md rename to proposals/p000447-generics-terminology.md diff --git a/proposals/p0524.md b/proposals/p000524-generics-overview.md similarity index 100% rename from proposals/p0524.md rename to proposals/p000524-generics-overview.md diff --git a/proposals/p0538.md b/proposals/p000538-return-with-no-argument.md similarity index 100% rename from proposals/p0538.md rename to proposals/p000538-return-with-no-argument.md diff --git a/proposals/p0540.md b/proposals/p000540-remove-void.md similarity index 100% rename from proposals/p0540.md rename to proposals/p000540-remove-void.md diff --git a/proposals/p0553.md b/proposals/p000553-generics-details-part-1.md similarity index 100% rename from proposals/p0553.md rename to proposals/p000553-generics-details-part-1.md diff --git a/proposals/p0555.md b/proposals/p000555-operator-precedence.md similarity index 98% rename from proposals/p0555.md rename to proposals/p000555-operator-precedence.md index acd9b4da143c..6aeca7aa03ff 100644 --- a/proposals/p0555.md +++ b/proposals/p000555-operator-precedence.md @@ -96,7 +96,7 @@ left-to-right arrow meaning a left-associative operator. For example:
-Example operator precedence diagram +Example operator precedence diagram
... would depict a higher-precedence `*` operator and a lower-precedence `+` @@ -111,8 +111,8 @@ With those precedence rules: - `a + b << c` would be an error, requiring parentheses, because the precedence levels of `+` and `<<` are unordered. -A [python script](p0555/figures.py) to generate these diagrams is included with -this proposal. +A [python script](p000555-operator-precedence/figures.py) to generate these +diagrams is included with this proposal. ### When to add precedence edges @@ -228,7 +228,7 @@ this ambiguity by excluding `primary_expression` from `add_expression` and systematically for any precedence partial ordering. A complete example of a yacc parser with operator precedence partial ordering is -available [alongside this proposal](p0555/yacc-parser). +available [alongside this proposal](p000555-operator-precedence/yacc-parser). ## Rationale based on Carbon's goals diff --git a/proposals/p0555/example.svg b/proposals/p000555-operator-precedence/example.svg similarity index 100% rename from proposals/p0555/example.svg rename to proposals/p000555-operator-precedence/example.svg diff --git a/proposals/p0555/figures.py b/proposals/p000555-operator-precedence/figures.py similarity index 100% rename from proposals/p0555/figures.py rename to proposals/p000555-operator-precedence/figures.py diff --git a/proposals/p0555/yacc-parser/Makefile b/proposals/p000555-operator-precedence/yacc-parser/Makefile similarity index 100% rename from proposals/p0555/yacc-parser/Makefile rename to proposals/p000555-operator-precedence/yacc-parser/Makefile diff --git a/proposals/p0555/yacc-parser/example.l b/proposals/p000555-operator-precedence/yacc-parser/example.l similarity index 100% rename from proposals/p0555/yacc-parser/example.l rename to proposals/p000555-operator-precedence/yacc-parser/example.l diff --git a/proposals/p0555/yacc-parser/example.y b/proposals/p000555-operator-precedence/yacc-parser/example.y similarity index 100% rename from proposals/p0555/yacc-parser/example.y rename to proposals/p000555-operator-precedence/yacc-parser/example.y diff --git a/proposals/p0561.md b/proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md similarity index 100% rename from proposals/p0561.md rename to proposals/p000561-basic-classes-use-cases-struct-literals-struct-types-and-future-work.md diff --git a/proposals/p0601.md b/proposals/p000601-operator-tokens.md similarity index 100% rename from proposals/p0601.md rename to proposals/p000601-operator-tokens.md diff --git a/proposals/p0618.md b/proposals/p000618-var-ordering.md similarity index 100% rename from proposals/p0618.md rename to proposals/p000618-var-ordering.md diff --git a/proposals/p0623.md b/proposals/p000623-require-braces.md similarity index 97% rename from proposals/p0623.md rename to proposals/p000623-require-braces.md index 0cfc0cae6140..3cb93b441df8 100644 --- a/proposals/p0623.md +++ b/proposals/p000623-require-braces.md @@ -36,8 +36,9 @@ for (Shape x : shapes) ``` Carbon adopted this design choice by default in proposals -[#285](/proposals/p0285.md), [#340](/proposals/p0340.md), and -[#353](/proposals/p0353.md). But should we keep it? +[#285](/proposals/p000285-if-else.md), +[#340](/proposals/p000340-while-loops.md), and +[#353](/proposals/p000353-for-loops.md). But should we keep it? ## Background diff --git a/proposals/p0646.md b/proposals/p000646-low-context-sensitivity-principle.md similarity index 100% rename from proposals/p0646.md rename to proposals/p000646-low-context-sensitivity-principle.md diff --git a/proposals/p0676.md b/proposals/p000676-generic-syntax.md similarity index 100% rename from proposals/p0676.md rename to proposals/p000676-generic-syntax.md diff --git a/proposals/p0680.md b/proposals/p000680-and-or-not.md similarity index 98% rename from proposals/p0680.md rename to proposals/p000680-and-or-not.md index 838179f3b08a..5581220aaf76 100644 --- a/proposals/p0680.md +++ b/proposals/p000680-and-or-not.md @@ -250,7 +250,7 @@ significant fraction of developers despite having been present across many languages for decades, leading to common recommendations to enable compiler warnings for the first form in the above example, suggesting to rewrite it as the second form. This therefore fails the test from proposal -[#555: when to add precedence edges](/proposals/p0555.md#when-to-add-precedence-edges). +[#555: when to add precedence edges](/proposals/p000555-operator-precedence.md#when-to-add-precedence-edges). ### Precedence of NOT @@ -328,7 +328,7 @@ Boolean type. However, we hope that a clearer syntax for that will be available, such as perhaps `x as Bool`. In the presence of such syntax, `not not x` would be an anti-pattern, and may indicate a bug due to an unintentionally repeated `not` operator. Per -[#555: when to add precedence edges](/proposals/p0555.md#when-to-add-precedence-edges), +[#555: when to add precedence edges](/proposals/p000555-operator-precedence.md#when-to-add-precedence-edges), when in doubt, we omit the precedence rule and wait for real-world experience. ### AND and OR produce the decisive value diff --git a/proposals/p0702.md b/proposals/p000702-comparison-operators.md similarity index 100% rename from proposals/p0702.md rename to proposals/p000702-comparison-operators.md diff --git a/proposals/p0720.md b/proposals/p000720-property-naming-in-c.md similarity index 100% rename from proposals/p0720.md rename to proposals/p000720-property-naming-in-c.md diff --git a/proposals/p0722.md b/proposals/p000722-nominal-classes-and-methods.md similarity index 100% rename from proposals/p0722.md rename to proposals/p000722-nominal-classes-and-methods.md diff --git a/proposals/p0731.md b/proposals/p000731-generics-details-2-adapters-associated-types-parameterized-interfaces.md similarity index 99% rename from proposals/p0731.md rename to proposals/p000731-generics-details-2-adapters-associated-types-parameterized-interfaces.md index 0c3457dcba48..b032e7a7bbf0 100644 --- a/proposals/p0731.md +++ b/proposals/p000731-generics-details-2-adapters-associated-types-parameterized-interfaces.md @@ -85,7 +85,7 @@ an associated type. The decision was to use `let` with `:!` to express that these are compile-time values, matching the use in classes described in proposal -[#772](p0722.md#let-constants). +[#772](p000722-nominal-classes-and-methods.md#let-constants). ``` interface Stack { diff --git a/proposals/p0752.md b/proposals/p000752-api-file-default-public.md similarity index 100% rename from proposals/p0752.md rename to proposals/p000752-api-file-default-public.md diff --git a/proposals/p0777.md b/proposals/p000777-inheritance.md similarity index 100% rename from proposals/p0777.md rename to proposals/p000777-inheritance.md diff --git a/proposals/p0818.md b/proposals/p000818-constraints-for-generics-generics-details-3.md similarity index 98% rename from proposals/p0818.md rename to proposals/p000818-constraints-for-generics-generics-details-3.md index c1643a844d7c..22550338608e 100644 --- a/proposals/p0818.md +++ b/proposals/p000818-constraints-for-generics-generics-details-3.md @@ -493,10 +493,10 @@ interface Collection { ``` One approach we considered is -[regular equivalence classes](p0818/regular_equivalence_classes.md), however we -have not yet been able to figure out how to ensure the algorithm terminates. -This is an approach we would like to reconsider if we find solutions to this -problem once can share this problem more widely. +[regular equivalence classes](p000818-constraints-for-generics-generics-details-3/regular_equivalence_classes.md), +however we have not yet been able to figure out how to ensure the algorithm +terminates. This is an approach we would like to reconsider if we find solutions +to this problem once can share this problem more widely. Other approaches we considered worked in simple cases but had requirements that could not be validated, since for example they were equivalent to solving the diff --git a/proposals/p0818/regular_equivalence_classes.md b/proposals/p000818-constraints-for-generics-generics-details-3/regular_equivalence_classes.md similarity index 100% rename from proposals/p0818/regular_equivalence_classes.md rename to proposals/p000818-constraints-for-generics-generics-details-3/regular_equivalence_classes.md diff --git a/proposals/p0820.md b/proposals/p000820-implicit-conversions.md similarity index 100% rename from proposals/p0820.md rename to proposals/p000820-implicit-conversions.md diff --git a/proposals/p0826.md b/proposals/p000826-function-return-type-inference.md similarity index 97% rename from proposals/p0826.md rename to proposals/p000826-function-return-type-inference.md index dd8305e5bc9f..3004983c2f41 100644 --- a/proposals/p0826.md +++ b/proposals/p000826-function-return-type-inference.md @@ -69,10 +69,10 @@ for declaring functions in order to maintain syntax parity. ### `auto` keyword This is the first proposal to formally include a use of `auto`; although -[`var` statement #339](p0339.md) mentions it in an alternative, the proposal did -not explicitly propose the keyword. However, the `var x: auto` use-case is -expected in Carbon, and so uses of `auto` here can be considered in that -context. +[`var` statement #339](p000339-var-statement.md) mentions it in an alternative, +the proposal did not explicitly propose the keyword. However, the `var x: auto` +use-case is expected in Carbon, and so uses of `auto` here can be considered in +that context. Note the `auto` keyword name and behavior can generally be considered consistent with C++. diff --git a/proposals/p0829.md b/proposals/p000829-one-way-principle.md similarity index 100% rename from proposals/p0829.md rename to proposals/p000829-one-way-principle.md diff --git a/proposals/p0845.md b/proposals/p000845-as-expressions.md similarity index 100% rename from proposals/p0845.md rename to proposals/p000845-as-expressions.md diff --git a/proposals/p0851.md b/proposals/p000851-variable-type-inference.md similarity index 96% rename from proposals/p0851.md rename to proposals/p000851-variable-type-inference.md index b316a7e900e7..26a5f8498e4e 100644 --- a/proposals/p0851.md +++ b/proposals/p000851-variable-type-inference.md @@ -37,9 +37,10 @@ we already make prevalent use in example code. ## Background -Although [#826: Function return type inference](p0826.md) introduced the `auto` -keyword for `fn`, the use type inference in `var` should be expected to be more -prevalent. +Although +[#826: Function return type inference](p000826-function-return-type-inference.md) +introduced the `auto` keyword for `fn`, the use type inference in `var` should +be expected to be more prevalent. In C++, `auto` can be used in variables as in: @@ -53,8 +54,8 @@ type, and is likely there as a matter of backwards compatibility. ### Variable type inference in other languages -[#618: var ordering](p0618.md) chose the ordering of var based on other -languages. Most of these also provide inferred variable types. +[#618: var ordering](p000618-var-ordering.md) chose the ordering of var based on +other languages. Most of these also provide inferred variable types. Where the `: ` syntax matches, here are a few example inferred types: diff --git a/proposals/p0861.md b/proposals/p000861-naming-conventions.md similarity index 100% rename from proposals/p0861.md rename to proposals/p000861-naming-conventions.md diff --git a/proposals/p0866.md b/proposals/p000866-allow-ties-in-floating-literals.md similarity index 93% rename from proposals/p0866.md rename to proposals/p000866-allow-ties-in-floating-literals.md index 4e17e7dc9ac1..35e7ff0be63f 100644 --- a/proposals/p0866.md +++ b/proposals/p000866-allow-ties-in-floating-literals.md @@ -28,10 +28,10 @@ suggested that we do not allow ties in floating-point literals. That is, given a literal whose value lies exactly half way between two representable values, we should reject rather than arbitrarily picking one of the two possibilities. -However, the [statistical argument](p0143.md#ties) presented in that proposal -misses an important fact: the distribution of the values that are exactly half -way between representable values includes several values of the form A x -10B, where A and B are small integers. +However, the [statistical argument](p000143-numeric-literals.md#ties) presented +in that proposal misses an important fact: the distribution of the values that +are exactly half way between representable values includes several values of the +form A x 10B, where A and B are small integers. For example, the current rule rejects this very reasonable looking code: diff --git a/proposals/p0875.md b/proposals/p000875-principle-information-accumulation.md similarity index 100% rename from proposals/p0875.md rename to proposals/p000875-principle-information-accumulation.md diff --git a/proposals/p0911.md b/proposals/p000911-conditional-expressions.md similarity index 100% rename from proposals/p0911.md rename to proposals/p000911-conditional-expressions.md diff --git a/proposals/p0920.md b/proposals/p000920-generic-blanket-impls-details-5.md similarity index 99% rename from proposals/p0920.md rename to proposals/p000920-generic-blanket-impls-details-5.md index daf8112e0b28..e311430de8f7 100644 --- a/proposals/p0920.md +++ b/proposals/p000920-generic-blanket-impls-details-5.md @@ -94,7 +94,8 @@ conditional conformance options: - The `extend` syntax inline in a class definition to establish a more specific `Self` type for conditional conformance choice was eliminated along - with [the `extend` syntax for external impls](p0553.md#extend-blocks). + with + [the `extend` syntax for external impls](p000553-generics-details-part-1.md#extend-blocks). - Consistency excluded using deduced arguments in square brackets after the `impl` keyword, and an `if` or `where` clause to add constraints: diff --git a/proposals/p0931.md b/proposals/p000931-generic-impls-access-details-4.md similarity index 100% rename from proposals/p0931.md rename to proposals/p000931-generic-impls-access-details-4.md diff --git a/proposals/p0950.md b/proposals/p000950-generics-details-6-remove-facets.md similarity index 100% rename from proposals/p0950.md rename to proposals/p000950-generics-details-6-remove-facets.md diff --git a/proposals/p0981.md b/proposals/p000981-implicit-conversions-for-aggregates.md similarity index 100% rename from proposals/p0981.md rename to proposals/p000981-implicit-conversions-for-aggregates.md diff --git a/proposals/p0983.md b/proposals/p000983-generics-details-7-final-impls.md similarity index 100% rename from proposals/p0983.md rename to proposals/p000983-generics-details-7-final-impls.md diff --git a/proposals/p0989.md b/proposals/p000989-member-access-expressions.md similarity index 100% rename from proposals/p0989.md rename to proposals/p000989-member-access-expressions.md diff --git a/proposals/p0990.md b/proposals/p000990-generics-details-8-interface-default-and-final-members.md similarity index 100% rename from proposals/p0990.md rename to proposals/p000990-generics-details-8-interface-default-and-final-members.md diff --git a/proposals/p0998.md b/proposals/p000998-principle-one-static-open-extension-mechanism.md similarity index 100% rename from proposals/p0998.md rename to proposals/p000998-principle-one-static-open-extension-mechanism.md diff --git a/proposals/p1013.md b/proposals/p001013-generics-set-associated-constants-using-where-constraints.md similarity index 100% rename from proposals/p1013.md rename to proposals/p001013-generics-set-associated-constants-using-where-constraints.md diff --git a/proposals/p1025.md b/proposals/p001025-roadmap-for-2022.md similarity index 100% rename from proposals/p1025.md rename to proposals/p001025-roadmap-for-2022.md diff --git a/proposals/p1083.md b/proposals/p001083-arithmetic-expressions.md similarity index 99% rename from proposals/p1083.md rename to proposals/p001083-arithmetic-expressions.md index 9581313f09a1..ca7ef8cb0122 100644 --- a/proposals/p1083.md +++ b/proposals/p001083-arithmetic-expressions.md @@ -637,7 +637,9 @@ var four_digit_number: Array(Char, 5) = ( We could use the same precedence rule as other languages, and permit examples similar to the above to be written without any parentheses. -However, our [rule for precedence](p0555.md#when-to-add-precedence-edges) is: +However, our +[rule for precedence](p000555-operator-precedence.md#when-to-add-precedence-edges) +is: > For every combination of operators, either it should be reasonable to expect > most or all developers who regularly use Carbon to reliably remember the diff --git a/proposals/p1084.md b/proposals/p001084-generics-details-9-forward-declarations.md similarity index 100% rename from proposals/p1084.md rename to proposals/p001084-generics-details-9-forward-declarations.md diff --git a/proposals/p1088.md b/proposals/p001088-generic-details-10-interface-implemented-requirements.md similarity index 100% rename from proposals/p1088.md rename to proposals/p001088-generic-details-10-interface-implemented-requirements.md diff --git a/proposals/p1144.md b/proposals/p001144-generic-details-11-operator-overloading.md similarity index 98% rename from proposals/p1144.md rename to proposals/p001144-generic-details-11-operator-overloading.md index f16e9c3ebd3d..db2ea8560ed9 100644 --- a/proposals/p1144.md +++ b/proposals/p001144-generic-details-11-operator-overloading.md @@ -51,7 +51,7 @@ by implementing interfaces, as in these proposals: Proposal [#702: Comparison operators](https://github.com/carbon-language/carbon-lang/pull/702) specified -[using interfaces for overloading the comparison operators](p0702.md#overloading), +[using interfaces for overloading the comparison operators](p000702-comparison-operators.md#overloading), but did not pin down specifically what those interfaces are. ## Proposal diff --git a/proposals/p1146.md b/proposals/p001146-generic-details-12-parameterized-types.md similarity index 100% rename from proposals/p1146.md rename to proposals/p001146-generic-details-12-parameterized-types.md diff --git a/proposals/p1154.md b/proposals/p001154-destructors.md similarity index 98% rename from proposals/p1154.md rename to proposals/p001154-destructors.md index 1da9fba705c1..bdc6d1d48b70 100644 --- a/proposals/p1154.md +++ b/proposals/p001154-destructors.md @@ -62,7 +62,7 @@ Destructors were discussed in open discussion on these dates: As part of [proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777), we decided to support extensible classes, that is non-abstract base classes, -[including with non-virtual destructors](p0777.md#no-extensible-objects-with-non-virtual-destructors). +[including with non-virtual destructors](p000777-inheritance.md#no-extensible-objects-with-non-virtual-destructors). ["Extensible classes" Google doc](https://docs.google.com/document/d/1gbQJN_IMJBnquOUUd2orbHLlAIqZ4pL0Vt7h34DkQjg/edit?resourcekey=0-0lkEvh0umUU206ASFlWc7A#) from that time considered options for making deleting extensible classes safer. @@ -266,7 +266,7 @@ both more concise and more clearly the opposite of "abstract." There were a few alternatives we considered that were specifically concerned about how to handle the unsafe case of deleting a pointer to a base class that does not have a virtual destructor, but may be pointing to a derived value. We -[decided to allow this case](p0777.md#no-extensible-objects-with-non-virtual-destructors) +[decided to allow this case](p000777-inheritance.md#no-extensible-objects-with-non-virtual-destructors) as part of [proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777). We decided to go with the proposed approach in diff --git a/proposals/p1178.md b/proposals/p001178-rework-operator-interfaces.md similarity index 100% rename from proposals/p1178.md rename to proposals/p001178-rework-operator-interfaces.md diff --git a/proposals/p1190.md b/proposals/p001190-reviewer-merged-prs.md similarity index 100% rename from proposals/p1190.md rename to proposals/p001190-reviewer-merged-prs.md diff --git a/proposals/p1191.md b/proposals/p001191-bitwise-and-shift-operators.md similarity index 100% rename from proposals/p1191.md rename to proposals/p001191-bitwise-and-shift-operators.md diff --git a/proposals/p1270.md b/proposals/p001270-update-and-expand-readme-content-and-motivation-for-carbon.md similarity index 100% rename from proposals/p1270.md rename to proposals/p001270-update-and-expand-readme-content-and-motivation-for-carbon.md diff --git a/proposals/p1280.md b/proposals/p001280-principle-all-apis-are-library-apis.md similarity index 100% rename from proposals/p1280.md rename to proposals/p001280-principle-all-apis-are-library-apis.md diff --git a/proposals/p1327.md b/proposals/p001327-generics-impl-forall.md similarity index 100% rename from proposals/p1327.md rename to proposals/p001327-generics-impl-forall.md diff --git a/proposals/p1344.md b/proposals/p001344-remove-llvm-from-the-repository-and-clean-up-history.md similarity index 100% rename from proposals/p1344.md rename to proposals/p001344-remove-llvm-from-the-repository-and-clean-up-history.md diff --git a/proposals/p1360.md b/proposals/p001360-change-raw-string-literal-syntax-represents-single-line-string-and-represents-block-string.md similarity index 100% rename from proposals/p1360.md rename to proposals/p001360-change-raw-string-literal-syntax-represents-single-line-string-and-represents-block-string.md diff --git a/proposals/p1363.md b/proposals/p001363-make-the-carbon-experiment-public.md similarity index 100% rename from proposals/p1363.md rename to proposals/p001363-make-the-carbon-experiment-public.md diff --git a/proposals/p1367.md b/proposals/p001367-remove-codeowners.md similarity index 100% rename from proposals/p1367.md rename to proposals/p001367-remove-codeowners.md diff --git a/proposals/p1382.md b/proposals/p001382-rename-me-self.md similarity index 100% rename from proposals/p1382.md rename to proposals/p001382-rename-me-self.md diff --git a/proposals/p1885.md b/proposals/p001885-for-statement-and-user-types.md similarity index 99% rename from proposals/p1885.md rename to proposals/p001885-for-statement-and-user-types.md index 4ae13ca69f25..80293722d7a0 100644 --- a/proposals/p1885.md +++ b/proposals/p001885-for-statement-and-user-types.md @@ -84,7 +84,7 @@ The goals for the solution includes: ## Background The original proposal of `for` loops were discussed in -[p0353](/proposals/p0353.md), and the basic design documented in +[#353](/proposals/p000353-for-loops.md), and the basic design documented in [control_flow/loops#for](/docs/design/control_flow/loops.md#for). The resulting syntax was: diff --git a/proposals/p1891.md b/proposals/p001891-are-we-explorer-yet.md similarity index 100% rename from proposals/p1891.md rename to proposals/p001891-are-we-explorer-yet.md diff --git a/proposals/p1964.md b/proposals/p001964-character-literals.md similarity index 97% rename from proposals/p1964.md rename to proposals/p001964-character-literals.md index 330cc887b7d6..fc528dd732cf 100644 --- a/proposals/p1964.md +++ b/proposals/p001964-character-literals.md @@ -102,13 +102,13 @@ like numeric literals: - A character literal is a sequence enclosed with single quotes delimiter ('), of UTF-8 code units that must be a valid encoding. This matches - [the UTF-8 encoding of Carbon source files](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0142.md#character-encoding). + [the UTF-8 encoding of Carbon source files](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000142-unicode-source-files.md#character-encoding). - A character literal must encode exactly one code point. - It supports addition and subtraction, [as described below](#operations). - Character literals will support the relevant subset of the backslash (`\`) escape sequences in string literals, including `\t`, `\n`, `\r`, `\"`, `\'`, `\\`, `\0`, and `\u{HHHH...}`. See - [String Literals: Escape sequence](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0199.md#escape-sequences). + [String Literals: Escape sequence](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000199-string-literals.md#escape-sequences). - Escape sequences which would result in non-UTF-8 encodings or more than one code point are not included. - The escape of an embedded newline is also excluded as it isn't expected @@ -230,9 +230,9 @@ information. Further, this design follows other standards set in place by previous proposals. For example following the -[String Literals: Escaping Sequence](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0199.md#escape-sequences-1) +[String Literals: Escaping Sequence](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000199-string-literals.md#escape-sequences-1) and representing characters as integers with the behaviour inline with -[Integer Literals](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0143.md). +[Integer Literals](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000143-numeric-literals.md). This also supports our goal for [Interoperability with and migration from existing C++ code](/docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code) @@ -314,7 +314,7 @@ other explicit type checks like in C++; a UTF-16 `u'`, UTF-32 `U'`, and wide characters `L'`. This would be more familiar for individuals coming to Carbon from a C++ background, and simplify our approach for C++ Interoperability. At the cost of diverge from existing standards, for example -[Proposal 142](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0142.md#character-encoding) +[Proposal 142](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000142-unicode-source-files.md#character-encoding) states all of Carbon source code should be UTF-8 encoded. Prefix declarations would detract the readability of the character literals and increase the complexity of character literal [Types](#types). diff --git a/proposals/p1983.md b/proposals/p001983-weaken-digit-separator-placement-rules.md similarity index 89% rename from proposals/p1983.md rename to proposals/p001983-weaken-digit-separator-placement-rules.md index b07292125cd6..2f8f59b3393e 100644 --- a/proposals/p1983.md +++ b/proposals/p001983-weaken-digit-separator-placement-rules.md @@ -26,9 +26,9 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ## Abstract -[Proposal #143: Numeric literals](/proposals/p0143.md) added digit separators -with strict rules for placement. It missed some use-cases. In order to address -this, remove placement rules for numeric literals. +[Proposal #143: Numeric literals](/proposals/p000143-numeric-literals.md) added +digit separators with strict rules for placement. It missed some use-cases. In +order to address this, remove placement rules for numeric literals. ## Problem @@ -44,8 +44,8 @@ Digit separator placement rules are too strict: ## Background -[Proposal #143: Numeric literals](/proposals/p0143.md) added digit separators -with strict rules for placement: +[Proposal #143: Numeric literals](/proposals/p000143-numeric-literals.md) added +digit separators with strict rules for placement: - For decimal integers, the digit separators shall occur every three digits starting from the right. For example, `2_147_483_648`. @@ -113,8 +113,8 @@ Disadvantages: Note that any regular grouping rule can present similar issues for Indian digit grouping conventions. -[Proposal #143: Numeric literals](/proposals/p0143.md) chose 3-digit decimal -groupings. +[Proposal #143: Numeric literals](/proposals/p000143-numeric-literals.md) chose +3-digit decimal groupings. Given there are overall advantages to not enforcing regular digit conventions, including for hex digits, it seems unnecessary to conform to the currently @@ -135,8 +135,8 @@ Hexadecimal digit groupings could be enforced along two axes: byte as in `FF_FF_FF_FF`, or irregular as in `FF_FFFFF_FF` which skips one placement. -[Proposal #143: Numeric literals](/proposals/p0143.md) chose 4-digit with -regular placement. +[Proposal #143: Numeric literals](/proposals/p000143-numeric-literals.md) chose +4-digit with regular placement. Advantages: @@ -162,9 +162,9 @@ best. ### Disallow digit separators in fractions -[Proposal #143: Numeric literals](/proposals/p0143.md) appears to disallow digit -separators in fractions. That is, in `1.2345`, `1.23_45` is disallowed. This -proposal changes that. +[Proposal #143: Numeric literals](/proposals/p000143-numeric-literals.md) +appears to disallow digit separators in fractions. That is, in `1.2345`, +`1.23_45` is disallowed. This proposal changes that. Advantages: diff --git a/proposals/p2006.md b/proposals/p002006-values-variables-pointers-and-references.md similarity index 99% rename from proposals/p2006.md rename to proposals/p002006-values-variables-pointers-and-references.md index 501045a2dbb3..ff6d32cccc62 100644 --- a/proposals/p2006.md +++ b/proposals/p002006-values-variables-pointers-and-references.md @@ -130,12 +130,12 @@ Leads questions which informed the design proposed here: - [What syntax should we use for pointer types? (#523)][#523] It also builds on the design of the proposal ["Initialization of memory and -variables"][p0257] ([#257]), implementing part of [#1993]. +variables"][#257] ([#257]), implementing part of [#1993]. [#257]: https://github.com/carbon-language/carbon-lang/pull/257 [#523]: https://github.com/carbon-language/carbon-lang/issues/523 [#1993]: https://github.com/carbon-language/carbon-lang/issues/1993 -[p0257]: /proposals/p0257.md +[#257]: /proposals/p000257-initialization-of-memory-and-variables.md ## Proposal diff --git a/proposals/p2015.md b/proposals/p002015-numeric-type-literal-syntax.md similarity index 100% rename from proposals/p2015.md rename to proposals/p002015-numeric-type-literal-syntax.md diff --git a/proposals/p2022.md b/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md similarity index 100% rename from proposals/p2022.md rename to proposals/p002022-unused-pattern-bindings-unused-function-parameters.md diff --git a/proposals/p2040.md b/proposals/p002040-unicode-escape-code-length.md similarity index 100% rename from proposals/p2040.md rename to proposals/p002040-unicode-escape-code-length.md diff --git a/proposals/p2107.md b/proposals/p002107-clarify-rules-around-self-and-self.md similarity index 100% rename from proposals/p2107.md rename to proposals/p002107-clarify-rules-around-self-and-self.md diff --git a/proposals/p2138.md b/proposals/p002138-checked-and-template-generic-terminology.md similarity index 100% rename from proposals/p2138.md rename to proposals/p002138-checked-and-template-generic-terminology.md diff --git a/proposals/p2173.md b/proposals/p002173-associated-constant-assignment-versus-equality.md similarity index 100% rename from proposals/p2173.md rename to proposals/p002173-associated-constant-assignment-versus-equality.md diff --git a/proposals/p2187.md b/proposals/p002187-update-sum-types-design.md similarity index 96% rename from proposals/p2187.md rename to proposals/p002187-update-sum-types-design.md index 4812fac352a7..360e9cd4a04a 100644 --- a/proposals/p2187.md +++ b/proposals/p002187-update-sum-types-design.md @@ -23,7 +23,8 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception ## Abstract -This proposal updates the design of [#157](p0157.md) to reflect subsequent +This proposal updates the design of +[#157](p000157-design-direction-for-sum-types.md) to reflect subsequent evolution of the language. ## Problem diff --git a/proposals/p2188.md b/proposals/p002188-pattern-matching-syntax-and-semantics.md similarity index 98% rename from proposals/p2188.md rename to proposals/p002188-pattern-matching-syntax-and-semantics.md index 588cfe36c67a..4859d7414a36 100644 --- a/proposals/p2188.md +++ b/proposals/p002188-pattern-matching-syntax-and-semantics.md @@ -211,8 +211,8 @@ fn H(n: i32) { ``` As specified in -[#2022](/proposals/p2022.md#the-behavior-of-unused-name-bindings), the `unused` -keyword indicates that the binding is intended to not be used. +[#2022](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md#the-behavior-of-unused-name-bindings), +the `unused` keyword indicates that the binding is intended to not be used. #### Wildcard @@ -221,7 +221,9 @@ ignore part of a value. - _binding-pattern_ ::= `_` `:` _expression_ -See [#2022](/proposals/p2022.md) for details. +See +[#2022](/proposals/p002022-unused-pattern-bindings-unused-function-parameters.md) +for details. The behavior is similar to that of an `unused` binding with a unique name. @@ -236,8 +238,10 @@ fn F(n: i32) { } ``` -As specified in [#1084](/proposals/p1084.md), function redeclarations may -replace named bindings with wildcards but may not use different names. +As specified in +[#1084](/proposals/p001084-generics-details-9-forward-declarations.md), function +redeclarations may replace named bindings with wildcards but may not use +different names. ``` fn G(n: i32); @@ -704,7 +708,7 @@ We will diagnose the following situations: ### Shorthand for `auto` We could provide a shorter syntax for `name: auto`. -[Proposal #851](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0851.md#elide-the-type-instead-of-using-auto) +[Proposal #851](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000851-variable-type-inference.md#elide-the-type-instead-of-using-auto) considered the following shorthands and decided against using them: ``` @@ -1115,7 +1119,8 @@ either syntactically or semantically. ### User-defined pattern matching We plan to provide a mechanism for allowing a user-defined type to specify how -it can be matched by patterns. See [proposal #157](/proposals/p0157.md) for +it can be matched by patterns. See +[proposal #157](/proposals/p000157-design-direction-for-sum-types.md) for details. ### Matching classes with struct patterns diff --git a/proposals/p2200.md b/proposals/p002200-template-generics.md similarity index 100% rename from proposals/p2200.md rename to proposals/p002200-template-generics.md diff --git a/proposals/p2240.md b/proposals/p002240-variadics.md similarity index 100% rename from proposals/p2240.md rename to proposals/p002240-variadics.md diff --git a/proposals/p2274.md b/proposals/p002274-subscript-syntax-and-semantics.md similarity index 100% rename from proposals/p2274.md rename to proposals/p002274-subscript-syntax-and-semantics.md diff --git a/proposals/p2287.md b/proposals/p002287-allow-unqualified-name-lookup.md similarity index 100% rename from proposals/p2287.md rename to proposals/p002287-allow-unqualified-name-lookup.md diff --git a/proposals/p2295.md b/proposals/p002295-begin-publishing-coc-and-moderation-transparency-reports.md similarity index 100% rename from proposals/p2295.md rename to proposals/p002295-begin-publishing-coc-and-moderation-transparency-reports.md diff --git a/proposals/p2347.md b/proposals/p002347-what-can-be-done-with-an-incomplete-interface.md similarity index 96% rename from proposals/p2347.md rename to proposals/p002347-what-can-be-done-with-an-incomplete-interface.md index e5e745b0bf42..f573502bc094 100644 --- a/proposals/p2347.md +++ b/proposals/p002347-what-can-be-done-with-an-incomplete-interface.md @@ -73,8 +73,8 @@ goal. In particular, we considered allowing the declaration of an interface or named constraint in an API file and the definition in the impl file of the same library. We considered some use cases that might benefit from this in -[#931](p0931.md#private-interfaces-in-public-api-files) and -[#971](https://github.com/carbon-language/carbon-lang/issues/971). In +[#931](p000931-generic-impls-access-details-4.md#private-interfaces-in-public-api-files) +and [#971](https://github.com/carbon-language/carbon-lang/issues/971). In [#generics-and-templates on 2022-10-24](https://discord.com/channels/655572317891461132/941071822756143115/1034207895392358431), we decided those use cases would be okay including the definition of the private interface in the API file. So to support checking for invalid uses of an diff --git a/proposals/p2360.md b/proposals/p002360-types-are-values-of-type-type.md similarity index 99% rename from proposals/p2360.md rename to proposals/p002360-types-are-values-of-type-type.md index d02a0372c782..f4d4c3dcbf83 100644 --- a/proposals/p2360.md +++ b/proposals/p002360-types-are-values-of-type-type.md @@ -94,8 +94,8 @@ This dual meaning has some problematic consequences: ## Background -- [#989: Member access expressions](/proposals/p0989.md) introduced the - current compound member access rules. +- [#989: Member access expressions](/proposals/p000989-member-access-expressions.md) + introduced the current compound member access rules. - [Issue #495](https://github.com/carbon-language/carbon-lang/issues/495) suggested adding an implicit conversion from tuples of types to type `Type`. - [Issue #508](https://github.com/carbon-language/carbon-lang/issues/508) diff --git a/proposals/p2365.md b/proposals/p002365-remove-artificial-version-ceiling-on-c-interop.md similarity index 100% rename from proposals/p2365.md rename to proposals/p002365-remove-artificial-version-ceiling-on-c-interop.md diff --git a/proposals/p2376.md b/proposals/p002376-constraints-must-use-self.md similarity index 100% rename from proposals/p2376.md rename to proposals/p002376-constraints-must-use-self.md diff --git a/proposals/p2483.md b/proposals/p002483-replace-keyword-is-with-impls.md similarity index 100% rename from proposals/p2483.md rename to proposals/p002483-replace-keyword-is-with-impls.md diff --git a/proposals/p2511.md b/proposals/p002511-assignment-statements.md similarity index 100% rename from proposals/p2511.md rename to proposals/p002511-assignment-statements.md diff --git a/proposals/p2550.md b/proposals/p002550-simplified-package-declaration-for-the-main-package.md similarity index 99% rename from proposals/p2550.md rename to proposals/p002550-simplified-package-declaration-for-the-main-package.md index 01850b0eee39..2e837c7c8990 100644 --- a/proposals/p2550.md +++ b/proposals/p002550-simplified-package-declaration-for-the-main-package.md @@ -246,7 +246,7 @@ import Foo library "Bar"; ``` This would lead to a more uniform syntax and, as noted in -[a very similar alternative considered by #107](/proposals/p0107.md#optional-package-names), +[a very similar alternative considered by #107](/proposals/p000107-code-and-name-organization.md#optional-package-names), would make it easier to search for all imports of a given library with a simple tool. diff --git a/proposals/p2551.md b/proposals/p002551-roadmap-for-2023-and-retrospective-for-2022.md similarity index 100% rename from proposals/p2551.md rename to proposals/p002551-roadmap-for-2023-and-retrospective-for-2022.md diff --git a/proposals/p2665.md b/proposals/p002665-semicolons-terminate-statements.md similarity index 100% rename from proposals/p2665.md rename to proposals/p002665-semicolons-terminate-statements.md diff --git a/proposals/p2687.md b/proposals/p002687-termination-algorithm-for-impl-selection.md similarity index 100% rename from proposals/p2687.md rename to proposals/p002687-termination-algorithm-for-impl-selection.md diff --git a/proposals/p2759.md b/proposals/p002759-defining-the-0-1-language.md similarity index 100% rename from proposals/p2759.md rename to proposals/p002759-defining-the-0-1-language.md diff --git a/proposals/p2760.md b/proposals/p002760-consistent-class-and-interface-syntax.md similarity index 100% rename from proposals/p2760.md rename to proposals/p002760-consistent-class-and-interface-syntax.md diff --git a/proposals/p2868.md b/proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md similarity index 98% rename from proposals/p2868.md rename to proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md index c3c8f33c333e..3b462bcaf992 100644 --- a/proposals/p2868.md +++ b/proposals/p002868-allow-overlap-with-a-final-impl-if-identical.md @@ -124,7 +124,7 @@ proposal, just restricted to the associated constants that are declared `final`. So we may still add this feature, if it is warranted by demand, but we did not yet have that justification. This is essentially the same position as when this feature was considered in -[proposal #983](/proposals/p0983.md#final-associated-constants-instead-of-final-impls). +[proposal #983](/proposals/p000983-generics-details-7-final-impls.md#final-associated-constants-instead-of-final-impls). ### Allow type inequality constraints diff --git a/proposals/p2875.md b/proposals/p002875-functions-function-types-and-function-calls.md similarity index 100% rename from proposals/p2875.md rename to proposals/p002875-functions-function-types-and-function-calls.md diff --git a/proposals/p2922.md b/proposals/p002922-introduce-a-new-conduct-team.md similarity index 100% rename from proposals/p2922.md rename to proposals/p002922-introduce-a-new-conduct-team.md diff --git a/proposals/p2964.md b/proposals/p002964-expression-phase-terminology.md similarity index 100% rename from proposals/p2964.md rename to proposals/p002964-expression-phase-terminology.md diff --git a/proposals/p3162.md b/proposals/p003162-reduce-ambiguity-in-terminology.md similarity index 94% rename from proposals/p3162.md rename to proposals/p003162-reduce-ambiguity-in-terminology.md index 22d912f8d913..4de8fa7cd89a 100644 --- a/proposals/p3162.md +++ b/proposals/p003162-reduce-ambiguity-in-terminology.md @@ -28,7 +28,8 @@ Change terminology away from terms that are ambiguous: - Reserve "generic type" for types with (compile-time) parameters, like `Vector` in `Vector(T:! type)`. Don't use that term to refer to `T`, as it - would with [#2360](/proposals/p2360.md#terminology). + would with + [#2360](/proposals/p002360-types-are-values-of-type-type.md#terminology). - Use the term "compile-time" instead of "constant" to mean "template or symbolic." Expand the term "constant" to include values, such as from `let` bindings. @@ -58,9 +59,10 @@ bindings. The two meanings of "generic type" come from: -- Proposal [#2360](/proposals/p2360.md#terminology) defines a generic type to - be a type or facet introduced by a `:!` binding, such as in a generic - parameter or associated constant. +- Proposal + [#2360](/proposals/p002360-types-are-values-of-type-type.md#terminology) + defines a generic type to be a type or facet introduced by a `:!` binding, + such as in a generic parameter or associated constant. - Other uses of the term generic, such as in generic function, mean a language construct with a compile-time parameter (as in [Rust](https://doc.rust-lang.org/rust-by-example/generics.html)). This is @@ -86,7 +88,7 @@ We make these changes: - Reserve "generic type" for types with (compile-time) parameters, like `Vector` in `Vector(T:! type)`. Don't use that term to refer to `T`, as it would with - [#2360](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p2360.md#terminology). + [#2360](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p002360-types-are-values-of-type-type.md#terminology). - Expand "constant binding" to include all `let` bindings. - Use the term "compile-time binding" to refer to the collection of template and symbolic bindings, such as from generic parameters and associated diff --git a/proposals/p3403.md b/proposals/p003403-change-main-default-to-an-api-file.md similarity index 100% rename from proposals/p3403.md rename to proposals/p003403-change-main-default-to-an-api-file.md diff --git a/proposals/p3407.md b/proposals/p003407-clarify-name-bindings-in-namespaces.md similarity index 100% rename from proposals/p3407.md rename to proposals/p003407-clarify-name-bindings-in-namespaces.md diff --git a/proposals/p3532.md b/proposals/p003532-focus-implementation-effort-on-the-toolchain.md similarity index 100% rename from proposals/p3532.md rename to proposals/p003532-focus-implementation-effort-on-the-toolchain.md diff --git a/proposals/p3564.md b/proposals/p003564-roadmap-for-2024-and-a-retrospective-for-2023.md similarity index 98% rename from proposals/p3564.md rename to proposals/p003564-roadmap-for-2024-and-a-retrospective-for-2023.md index faadf9f4ed9f..c6ef4dbba10c 100644 --- a/proposals/p3564.md +++ b/proposals/p003564-roadmap-for-2024-and-a-retrospective-for-2023.md @@ -99,7 +99,8 @@ Breaking down the specific key results we aimed at for 2023: [mvp-milestone]: /docs/project/milestones.md#milestone-01-a-minimum-viable-product-mvp-for-evaluation -[toolchain-pivot]: /proposals/p3532.md +[toolchain-pivot]: + /proposals/p003532-focus-implementation-effort-on-the-toolchain.md Overall, 2023 was pretty amazing, and we hit some of the most important milestones in the project over the past year. diff --git a/proposals/p3646.md b/proposals/p003646-tuples-and-tuple-indexing.md similarity index 100% rename from proposals/p3646.md rename to proposals/p003646-tuples-and-tuple-indexing.md diff --git a/proposals/p3720.md b/proposals/p003720-member-binding-operators.md similarity index 99% rename from proposals/p3720.md rename to proposals/p003720-member-binding-operators.md index 2832354b5028..29eff8d156fa 100644 --- a/proposals/p3720.md +++ b/proposals/p003720-member-binding-operators.md @@ -203,7 +203,8 @@ class __Binding_C_F { These are the types that result from [instance binding](/docs/design/expressions/member_access.md#instance-binding) an instance of `C` with these member names. They define the bound method value -and bound method type of [proposal #2875](/proposals/p2875.md#bound-methods). +and bound method type of +[proposal #2875](/proposals/p002875-functions-function-types-and-function-calls.md#bound-methods). For example, ```carbon @@ -1059,7 +1060,8 @@ Addressing this is [out of scope of the current proposal](#background). We could instead make `c.Increment` be a value holding `&c`. That would allow `Call` to work even when taking `self` by value. This is the solution likely -implied by the current [proposal #2875](/proposals/p2875.md#bound-methods), +implied by the current +[proposal #2875](/proposals/p002875-functions-function-types-and-function-calls.md#bound-methods), though that proposal does not say what the bound method type is at all. It leaves two other problems, however: diff --git a/proposals/p3762.md b/proposals/p003762-merging-forward-declarations.md similarity index 100% rename from proposals/p3762.md rename to proposals/p003762-merging-forward-declarations.md diff --git a/proposals/p3763.md b/proposals/p003763-matching-redeclarations.md similarity index 99% rename from proposals/p3763.md rename to proposals/p003763-matching-redeclarations.md index d00995c34033..5420ee74fc20 100644 --- a/proposals/p3763.md +++ b/proposals/p003763-matching-redeclarations.md @@ -60,7 +60,8 @@ know: [Leads issue #1132](https://github.com/carbon-language/carbon-lang/issues/1132) has rules for this, and those rules were partially incorporated into the design -by [#1084 Generics details 9: forward declarations](/proposals/p1084.md). +by +[#1084 Generics details 9: forward declarations](/proposals/p001084-generics-details-9-forward-declarations.md). However: - #1084 only covers generics, not the whole scope of the language, and diff --git a/proposals/p3797.md b/proposals/p003797-raw-identifier-syntax.md similarity index 100% rename from proposals/p3797.md rename to proposals/p003797-raw-identifier-syntax.md diff --git a/proposals/p3833.md b/proposals/p003833-semir-fidelity-when-representing-rewrite-semantics.md similarity index 100% rename from proposals/p3833.md rename to proposals/p003833-semir-fidelity-when-representing-rewrite-semantics.md diff --git a/proposals/p3848.md b/proposals/p003848-lambdas.md similarity index 100% rename from proposals/p3848.md rename to proposals/p003848-lambdas.md diff --git a/proposals/p3927.md b/proposals/p003927-more-consistent-package-syntax.md similarity index 94% rename from proposals/p3927.md rename to proposals/p003927-more-consistent-package-syntax.md index 3178a7da8224..51eaa4b71844 100644 --- a/proposals/p3927.md +++ b/proposals/p003927-more-consistent-package-syntax.md @@ -56,9 +56,9 @@ declarations: ## Background -[Proposal #107: Code and name organization](/proposals/p0107.md) introduced the -current syntax. It did -[consider the possibility of omitting the `api` keyword](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0107.md#different-file-type-labels): +[Proposal #107: Code and name organization](/proposals/p000107-code-and-name-organization.md) +introduced the current syntax. It did +[consider the possibility of omitting the `api` keyword](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000107-code-and-name-organization.md#different-file-type-labels): > We've considered dropping `api` from naming, but that creates a definition > from absence of a keyword. It also would be more unusual if both `impl` and @@ -70,7 +70,8 @@ between the choice made for package declaration and the choices made for other declarations, because those inconsistencies were created by later changes: - #107 used the `api` keyword as a marker for exporting names from an API - file. Later, [proposal #752: api file default public](/proposals/p0752.md) + file. Later, + [proposal #752: api file default public](/proposals/p000752-api-file-default-public.md) removed this use of the `api` keyword, with the new rule being that declarations are in the public API by default, with an explicit keyword used to mark non-public declarations. This removed all uses of the `api` keyword diff --git a/proposals/p3938.md b/proposals/p003938-exporting-imported-names.md similarity index 100% rename from proposals/p3938.md rename to proposals/p003938-exporting-imported-names.md diff --git a/proposals/p3980.md b/proposals/p003980-singular-extern-declarations.md similarity index 100% rename from proposals/p3980.md rename to proposals/p003980-singular-extern-declarations.md diff --git a/proposals/p4075.md b/proposals/p004075-change-operator-precedence.md similarity index 100% rename from proposals/p4075.md rename to proposals/p004075-change-operator-precedence.md diff --git a/proposals/p4105.md b/proposals/p004105-establish-toolchain-and-language-versioning.md similarity index 100% rename from proposals/p4105.md rename to proposals/p004105-establish-toolchain-and-language-versioning.md diff --git a/proposals/p4246.md b/proposals/p004246-getting-commit-access.md similarity index 100% rename from proposals/p4246.md rename to proposals/p004246-getting-commit-access.md diff --git a/proposals/p4682.md b/proposals/p004682-the-core-array-type-for-direct-storage-immutably-sized-buffers.md similarity index 98% rename from proposals/p4682.md rename to proposals/p004682-the-core-array-type-for-direct-storage-immutably-sized-buffers.md index 9cd080a89268..1bd13e153a00 100644 --- a/proposals/p4682.md +++ b/proposals/p004682-the-core-array-type-for-direct-storage-immutably-sized-buffers.md @@ -281,7 +281,7 @@ that must be overcome by developers. ### No predeclared identifiers Recently the proposal -[p4864: No predeclared identifiers, Core is a keyword](https://docs.carbon-lang.dev/proposals/p4864.html) +[#4864: No predeclared identifiers, Core is a keyword](p004864-no-predeclared-identifiers-core-is-a-keyword.md) clarified a direction for the Carbon language, wherein there will not be implicit imports from the `Core` library. Anything accessible directly in the language, rather than through a package name, is done so through a builtin @@ -359,7 +359,7 @@ placing it in the `prelude` library. This avoids the need for developers to Since array types are expected to be very frequent, we also propose an `array` builtin keyword as a shorthand. This is in line with the -[No predeclared identifiers](https://docs.carbon-lang.dev/proposals/p4864.html) +[No predeclared identifiers](p004864-no-predeclared-identifiers-core-is-a-keyword.md) proposal, and uses a lowercase spelling to mark the word as a builtin. The spelling of `array(T, N)` will resolve to the library type `Core.Array(T, N)`. @@ -477,5 +477,5 @@ different things: The first is the keyword, and the second is a name that the developer can use freely for other purposes. The -[No predeclared identifiers, Core is a keyword](https://docs.carbon-lang.dev/proposals/p4864.html) +[No predeclared identifiers, Core is a keyword](p004864-no-predeclared-identifiers-core-is-a-keyword.md) proposal discusses in more detail why this approach was not taken. diff --git a/proposals/p4864.md b/proposals/p004864-no-predeclared-identifiers-core-is-a-keyword.md similarity index 100% rename from proposals/p4864.md rename to proposals/p004864-no-predeclared-identifiers-core-is-a-keyword.md diff --git a/proposals/p4880.md b/proposals/p004880-safety-milestones-and-a-2025-roadmap.md similarity index 100% rename from proposals/p4880.md rename to proposals/p004880-safety-milestones-and-a-2025-roadmap.md diff --git a/proposals/p5017.md b/proposals/p005017-destructor-syntax.md similarity index 98% rename from proposals/p5017.md rename to proposals/p005017-destructor-syntax.md index 558fe537e5b3..534dc8245e0e 100644 --- a/proposals/p5017.md +++ b/proposals/p005017-destructor-syntax.md @@ -100,7 +100,7 @@ function. Although the syntax of `fn destroy` looks similar to a regular function, the functions are not designed to be directly callable. This does not add support for `my_var.destroy()`. See Proposal #1154, alternative -[Allow functions to act as destructors](/proposals/p1154.md#allow-functions-to-act-as-destructors) +[Allow functions to act as destructors](/proposals/p001154-destructors.md#allow-functions-to-act-as-destructors) for details. ## Future work diff --git a/proposals/p5087.md b/proposals/p005087-qualified-lookup-into-types-being-defined.md similarity index 99% rename from proposals/p5087.md rename to proposals/p005087-qualified-lookup-into-types-being-defined.md index 8cc88dd9ef62..457f65cd0246 100644 --- a/proposals/p5087.md +++ b/proposals/p005087-qualified-lookup-into-types-being-defined.md @@ -74,7 +74,7 @@ namespace is never known. ## Background Proposal -[#3763](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3763.md) +[#3763](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p003763-matching-redeclarations.md) introduces a name poisoning rule: > In a declarative scope, it is an error if a name is first looked up and not diff --git a/proposals/p5164.md b/proposals/p005164-updates-to-pattern-matching-for-objects.md similarity index 100% rename from proposals/p5164.md rename to proposals/p005164-updates-to-pattern-matching-for-objects.md diff --git a/proposals/p5168.md b/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md similarity index 99% rename from proposals/p5168.md rename to proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md index e8962c119c09..1412f0f97a62 100644 --- a/proposals/p5168.md +++ b/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md @@ -285,7 +285,7 @@ satisfy requirements in more situations. In particular, we make these changes: library) as its declaration. - However, the definitions of its member functions may be separate in the impl file, out of line, as provided in - [proposal #3763](/proposals/p3763.md#out-of-line-definitions-of-associated-functions). + [proposal #3763](/proposals/p003763-matching-redeclarations.md#out-of-line-definitions-of-associated-functions). - An `impl` may be forward declared without the interface being defined. - This is enabled by not needing access to the definition to see other interfaces required or extended or to see the associated constants that diff --git a/proposals/p5233.md b/proposals/p005233-towards-more-async-sync-ing.md similarity index 100% rename from proposals/p5233.md rename to proposals/p005233-towards-more-async-sync-ing.md diff --git a/proposals/p5270.md b/proposals/p005270-move-explorer-out-of-toolchain-git-repository.md similarity index 96% rename from proposals/p5270.md rename to proposals/p005270-move-explorer-out-of-toolchain-git-repository.md index c2a115312f86..ff2bb61d4589 100644 --- a/proposals/p5270.md +++ b/proposals/p005270-move-explorer-out-of-toolchain-git-repository.md @@ -60,7 +60,7 @@ explorer tests[^2][^3][^4]. ## Background - Previous proposal: - [#3532: Focus implementation effort on the toolchain](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md) + [#3532: Focus implementation effort on the toolchain](p003532-focus-implementation-effort-on-the-toolchain.md) - Kick-off of this discussion [#5224](https://github.com/carbon-language/carbon-lang/pull/5224#pullrequestreview-2730512195) - Discord discussion: @@ -102,8 +102,7 @@ maintain searchability, the explorer codebase must either remain on `trunk` in `carbon-lang` or in a sibling repository. GitHub search does continue to work in archived repositories. -Proposal -[p3532](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md) +Proposal [#3532](p003532-focus-implementation-effort-on-the-toolchain.md) directed to keep the explorer codebase active in the main repository, with its tests building and running: diff --git a/proposals/p5337.md b/proposals/p005337-interface-extension-and-final-impl-update.md similarity index 99% rename from proposals/p5337.md rename to proposals/p005337-interface-extension-and-final-impl-update.md index 2c973aafff6b..969cf0c5d125 100644 --- a/proposals/p5337.md +++ b/proposals/p005337-interface-extension-and-final-impl-update.md @@ -986,8 +986,9 @@ final `impl`). In order to detect the subsumption, the query for the final The generated `impl` from an `extend impl` in an interface is given a name similar to an `impl` defined in a `class` scope, as [discussed on 2024-03-11](https://docs.google.com/document/d/1s3mMCupmuSpWOFJGnvjoElcBIe2aoaysTIdyczvKX84/edit?resourcekey=0-G095Wc3sR6pW1hLJbGgE0g&tab=t.0#heading=h.p69b78lovqb7), -mentioned in [proposal #3763](/proposals/p3763.md#redeclarations), and proposed -in pending +mentioned in +[proposal #3763](/proposals/p003763-matching-redeclarations.md#redeclarations), +and proposed in pending [proposal #5366](https://github.com/carbon-language/carbon-lang/pull/5366). For example, these names can be used to allow multiple interfaces to extend a @@ -1141,7 +1142,7 @@ rules. ### No default `Self` in `require Self impls I` Shortening of `require Self impls I` to just `require I` was considered in -[proposal #2760](p2760.md#allow-interfaces-to-require-another-interface-without-writing-self-impls). +[proposal #2760](p002760-consistent-class-and-interface-syntax.md#allow-interfaces-to-require-another-interface-without-writing-self-impls). It was not chosen to be consistent with `where` clauses, but the door was left open if it was found to be too verbose. The `require impls I` approach adopted by this proposal, though, could be extended to work with `where` as well. The diff --git a/proposals/p5366.md b/proposals/p005366-the-name-of-an-impl-in-class-scope.md similarity index 96% rename from proposals/p5366.md rename to proposals/p005366-the-name-of-an-impl-in-class-scope.md index e3ae276f78d0..9a134d816a9b 100644 --- a/proposals/p5366.md +++ b/proposals/p005366-the-name-of-an-impl-in-class-scope.md @@ -94,13 +94,14 @@ The need for forward declarations of entities comes from the [Leads issue #1132](https://github.com/carbon-language/carbon-lang/issues/1132) defined the initial rules for matching forward declarations to their definitions. Those rules were partially incorporated into the design by -[proposal #1084, "Generics details 9: forward declarations"](/proposals/p1084.md). +[proposal #1084, "Generics details 9: forward declarations"](/proposals/p001084-generics-details-9-forward-declarations.md). A replacement approach was [discussed on 2024-03-11](https://docs.google.com/document/d/1s3mMCupmuSpWOFJGnvjoElcBIe2aoaysTIdyczvKX84/edit?resourcekey=0-G095Wc3sR6pW1hLJbGgE0g&tab=t.0#heading=h.p69b78lovqb7) -and mentioned in [proposal #3763](/proposals/p3763.md#redeclarations). This is -the approach of syntactic matching and re-entering the same scope. The syntax -adopted by this proposal was first suggested in those. +and mentioned in +[proposal #3763](/proposals/p003763-matching-redeclarations.md#redeclarations). +This is the approach of syntactic matching and re-entering the same scope. The +syntax adopted by this proposal was first suggested in those. [Proposal #3762: Merging forward declarations](https://github.com/carbon-language/carbon-lang/pull/3762) and diff --git a/proposals/p5434.md b/proposals/p005434-ref-parameters-arguments-returns-and-val-returns.md similarity index 99% rename from proposals/p5434.md rename to proposals/p005434-ref-parameters-arguments-returns-and-val-returns.md index d2d7cbec91fe..aa2ce1f7b5c0 100644 --- a/proposals/p5434.md +++ b/proposals/p005434-ref-parameters-arguments-returns-and-val-returns.md @@ -121,7 +121,7 @@ won't. - Using [the `addr` keyword on mutating methods to get a `self` with a pointer type](/docs/design/classes.md#methods) was introduced in - [proposal #722: "Nominal classes and methods"](/proposals/p0722.md#keyword-to-indicate-pass-by-address). + [proposal #722: "Nominal classes and methods"](/proposals/p000722-nominal-classes-and-methods.md#keyword-to-indicate-pass-by-address). - [Leads issue #5261: "We should add `ref` bindings to Carbon, paralleling reference expressions"](https://github.com/carbon-language/carbon-lang/issues/5261) supports adding `ref` bindings to Carbon. - [LLVM's `noalias` attribute](https://llvm.org/docs/LangRef.html#function-attributes) @@ -1146,7 +1146,7 @@ though, such as temporaries that are reachable transitively through pointers. ### `ref` bindings in lambdas We have already identified -[future work to support reference captures in lambdas as part of proposal #3848](/proposals/p3848.md#future-work-reference-captures). +[future work to support reference captures in lambdas as part of proposal #3848](/proposals/p003848-lambdas.md#future-work-reference-captures). This might be a reason to support `ref` bindings as fields of objects, with all the restrictions that comes with that. diff --git a/proposals/p5448.md b/proposals/p005448-carbon-c-interop-primitive-types.md similarity index 83% rename from proposals/p5448.md rename to proposals/p005448-carbon-c-interop-primitive-types.md index 24fa97b52fb5..1252b8dd05d6 100644 --- a/proposals/p5448.md +++ b/proposals/p005448-carbon-c-interop-primitive-types.md @@ -69,11 +69,15 @@ The following data models are widely accepted: [Carbon supported platforms](/docs/project/principles/success_criteria.md#modern-os-platforms-hardware-architectures-and-environments) Carbon will prioritize supporting modern OS, 64-bit little endian platforms (for -example [LLP64](/proposals/p5448.md#data-models), -[LP64](/proposals/p5448.md#data-models)). Historic platforms like -[LP32](/proposals/p5448.md#data-models) won't be supported. +example +[LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models), +[LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models)). +Historic platforms like +[LP32](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models) won't +be supported. -For clarity, the text below omits [LP32](/proposals/p5448.md#data-models) +For clarity, the text below omits +[LP32](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models) relevant information and focuses only on the Carbon supported platforms. ### Carbon Primitive Types @@ -155,68 +159,68 @@ not itself a pointer type. **Standard signed integer types** -| Type | Width in bits | -| ------------- | ------------------------------------------------------------------------------------------------- | -| `signed char` | 8-bit | -| `short` | 16-bit | -| `int` | 32-bit | -| `long` | [LLP64](/proposals/p5448.md#data-models): 32-bit; [LP64](/proposals/p5448.md#data-models): 64-bit | -| `long long` | 64-bit | +| Type | Width in bits | +| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signed char` | 8-bit | +| `short` | 16-bit | +| `int` | 32-bit | +| `long` | [LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): 32-bit; [LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): 64-bit | +| `long long` | 64-bit | **Exact-width integer types** Typically aliases of the standard integer types. -| Type | Width in bits | Defined as | -| -------------- | ------------- | ---------------------------------------------------------------------------- | -| `std::int8_t` | 8-bit | `typedef signed char int8_t` | -| `std::int16_t` | 16-bit | `typedef signed short int16_t` | -| `std::int32_t` | 32-bit | `typedef signed int int32_t` | -| `std::int64_t` | 64-bit | [LLP64](/proposals/p5448.md#data-models): `typedef signed long long int64_t` | -| | | [LP64](/proposals/p5448.md#data-models): `typedef signed long int64_t` | +| Type | Width in bits | Defined as | +| -------------- | ------------- | --------------------------------------------------------------------------------------------------------------- | +| `std::int8_t` | 8-bit | `typedef signed char int8_t` | +| `std::int16_t` | 16-bit | `typedef signed short int16_t` | +| `std::int32_t` | 32-bit | `typedef signed int int32_t` | +| `std::int64_t` | 64-bit | [LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long long int64_t` | +| | | [LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long int64_t` | **Fastest minimum-width integer types** Integer types that are usually fastest to operate with among all integer types that have the minimum specified width. -| Type | Width in bits | Defined as | -| ------------------- | ------------- | --------------------------------------------------------------------------------- | -| `std::int_fast8_t` | >=8-bit | `typedef signed char int_fast8_t` | -| `std::int_fast16_t` | >=16-bit | implementation dependent | -| `std::int_fast32_t` | >=32-bit | implementation dependent | -| `std::int_fast64_t` | >=64-bit | [LLP64](/proposals/p5448.md#data-models): `typedef signed long long int_fast64_t` | -| | | [LP64](/proposals/p5448.md#data-models): `typedef signed long int_fast64_t` | +| Type | Width in bits | Defined as | +| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------- | +| `std::int_fast8_t` | >=8-bit | `typedef signed char int_fast8_t` | +| `std::int_fast16_t` | >=16-bit | implementation dependent | +| `std::int_fast32_t` | >=32-bit | implementation dependent | +| `std::int_fast64_t` | >=64-bit | [LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long long int_fast64_t` | +| | | [LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long int_fast64_t` | **Minimum-width integer types** Smallest signed integer type with width of at least N-bits. -| Type | Width in bits | Defined as | -| -------------------- | ------------- | ---------------------------------------------------------------------------------- | -| `std::int_least8_t` | >=8-bit | `typedef signed char int_least8_t` | -| `std::int_least16_t` | >=16-bit | `typedef short int_least16_t` | -| `std::int_least32_t` | >=32-bit | `typedef int int_least32_t` | -| `std::int_least64_t` | >=64-bit | [LLP64](/proposals/p5448.md#data-models): `typedef signed long long int_least64_t` | -| | | [LP64](/proposals/p5448.md#data-models): `typedef signed long int_least64_t` | +| Type | Width in bits | Defined as | +| -------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------- | +| `std::int_least8_t` | >=8-bit | `typedef signed char int_least8_t` | +| `std::int_least16_t` | >=16-bit | `typedef short int_least16_t` | +| `std::int_least32_t` | >=32-bit | `typedef int int_least32_t` | +| `std::int_least64_t` | >=64-bit | [LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long long int_least64_t` | +| | | [LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long int_least64_t` | **Greatest-width integer types** Maximum-width signed integer type. -| Type | Width in bits | Defined as | -| --------------- | ------------- | ----------------------------------------------------------------------------- | -| `std::intmax_t` | >=32-bit | [LLP64](/proposals/p5448.md#data-models): `typedef signed long long intmax_t` | -| | | [LP64](/proposals/p5448.md#data-models): `typedef signed long intmax_t` | +| Type | Width in bits | Defined as | +| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- | +| `std::intmax_t` | >=32-bit | [LLP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long long intmax_t` | +| | | [LP64](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models): `typedef signed long intmax_t` | **Integer types capable of holding object pointers** Signed integer type, capable of holding any pointer. -| Type | Width in bits | Defined as | -| --------------- | ------------- | -------------------------------------------------------------------- | -| `std::intptr_t` | >=16-bit | most platforms: `typedef long intptr_t` | -| | | some [ILP32](/proposals/p5448.md#data-models):`typedef int intptr_t` | +| Type | Width in bits | Defined as | +| --------------- | ------------- | ------------------------------------------------------------------------------------------------------- | +| `std::intptr_t` | >=16-bit | most platforms: `typedef long intptr_t` | +| | | some [ILP32](/proposals/p005448-carbon-c-interop-primitive-types.md#data-models):`typedef int intptr_t` | **Other signed integer types** @@ -228,7 +232,7 @@ Signed integer type, capable of holding any pointer. #### Unsigned integer types The unsigned integer types have the same sizes as their -[signed counterparts](/proposals/p5448.md#signed-integer-types). +[signed counterparts](/proposals/p005448-carbon-c-interop-primitive-types.md#signed-integer-types). | Type | Width in bits | Defined as | | -------- | ------------- | ------------------------------------------ | diff --git a/proposals/p5545.md b/proposals/p005545-expression-form-basics.md similarity index 100% rename from proposals/p5545.md rename to proposals/p005545-expression-form-basics.md diff --git a/proposals/p5606.md b/proposals/p005606-keep-design-documents-current.md similarity index 96% rename from proposals/p5606.md rename to proposals/p005606-keep-design-documents-current.md index 3dfaf77fc490..9baab52e60ae 100644 --- a/proposals/p5606.md +++ b/proposals/p005606-keep-design-documents-current.md @@ -62,11 +62,11 @@ changes are necessarily best-effort, because it wasn't feasible for me to fully evaluate every proposal against the current state of the docs. In particular, I didn't look at proposals numbered below 2000, and I assumed that proposals fully updated `/docs/design` if they touched it at all. In addition, I did not add -"TODO" comments for the terminology changes in [p2964](/proposals/p2964.md), -because they would be pervasive, and probably add little value for the reader. -Instead, I filed issue -[#5599](https://github.com/carbon-language/carbon-lang/issues/5599) to track the -task of making those changes. +"TODO" comments for the terminology changes in +[#2964](/proposals/p002964-expression-phase-terminology.md), because they would +be pervasive, and probably add little value for the reader. Instead, I filed +issue [#5599](https://github.com/carbon-language/carbon-lang/issues/5599) to +track the task of making those changes. ## Details diff --git a/proposals/p5661.md b/proposals/p005661-progressive-disclosure-principle.md similarity index 100% rename from proposals/p5661.md rename to proposals/p005661-progressive-disclosure-principle.md diff --git a/proposals/p5670.md b/proposals/p005670-guidance-on-ai-coding-tools.md similarity index 100% rename from proposals/p5670.md rename to proposals/p005670-guidance-on-ai-coding-tools.md diff --git a/proposals/p5689.md b/proposals/p005689-semantic-identity-and-order-dependent-resolution-for-rewrite-constraints.md similarity index 100% rename from proposals/p5689.md rename to proposals/p005689-semantic-identity-and-order-dependent-resolution-for-rewrite-constraints.md diff --git a/proposals/p5914.md b/proposals/p005914-updating-carbon-s-safety-strategy.md similarity index 100% rename from proposals/p5914.md rename to proposals/p005914-updating-carbon-s-safety-strategy.md diff --git a/proposals/p6008.md b/proposals/p006008-replace-impl-fn-with-override-fn.md similarity index 100% rename from proposals/p6008.md rename to proposals/p006008-replace-impl-fn-with-override-fn.md diff --git a/proposals/p6177.md b/proposals/p006177-c-interop-mapping-std-string-view-to-core-str.md similarity index 100% rename from proposals/p6177.md rename to proposals/p006177-c-interop-mapping-std-string-view-to-core-str.md diff --git a/proposals/p6231.md b/proposals/p006231-disambiguate-value-binding.md similarity index 100% rename from proposals/p6231.md rename to proposals/p006231-disambiguate-value-binding.md diff --git a/proposals/p6254.md b/proposals/p006254-c-interop-toolchain-implementation-for-function-calls.md similarity index 98% rename from proposals/p6254.md rename to proposals/p006254-c-interop-toolchain-implementation-for-function-calls.md index 8cb829109e84..6ccb6f222380 100644 --- a/proposals/p6254.md +++ b/proposals/p006254-c-interop-toolchain-implementation-for-function-calls.md @@ -54,7 +54,7 @@ understand. Several challenges arise at the toolchain level: to the correct C++ function within an overload set. - C++ types do not always have identical representations or ABIs to their Carbon counterparts (see - [Carbon <-> C++ Interop: Primitive Types](https://github.com/carbon-language/carbon-lang/blob/44b2f60c90df5c1b0ce86f97bb0ece2a94eb50ea/proposals/p5448.md)). + [Carbon <-> C++ Interop: Primitive Types](https://github.com/carbon-language/carbon-lang/blob/44b2f60c90df5c1b0ce86f97bb0ece2a94eb50ea/proposals/p005448-carbon-c-interop-primitive-types.md)). For example, parameter passing conventions (by value, by pointer) or return value handling (direct return versus return slot) might differ. This may require the toolchain to synthesize adapter code. @@ -117,7 +117,7 @@ be an overload set imported from C++: [`clang::OpaqueValueExpr`](https://github.com/llvm/llvm-project/blob/1e99026b45b048a52f8372399ab83d488132842e/clang/include/clang/AST/Expr.h#L1178)). The types of these expressions are determined by mapping the Carbon argument types to corresponding C++ types - ([Carbon <-> C++ Interop: Primitive Types](https://github.com/carbon-language/carbon-lang/blob/44b2f60c90df5c1b0ce86f97bb0ece2a94eb50ea/proposals/p5448.md)). + ([Carbon <-> C++ Interop: Primitive Types](https://github.com/carbon-language/carbon-lang/blob/44b2f60c90df5c1b0ce86f97bb0ece2a94eb50ea/proposals/p005448-carbon-c-interop-primitive-types.md)). 2. **Invoke Clang Sema:** Carbon invokes Clang's overload resolution logic ([`clang::OverloadCandidateSet::BestViableFunction()`](https://github.com/llvm/llvm-project/blob/1e99026b45b048a52f8372399ab83d488132842e/clang/include/clang/Sema/Overload.h#L1456)) with the mapped C++ name, the candidate functions from the imported overload diff --git a/proposals/p6333.md b/proposals/p006333-cli-and-separate-compilation.md similarity index 100% rename from proposals/p6333.md rename to proposals/p006333-cli-and-separate-compilation.md diff --git a/proposals/p6357.md b/proposals/p006357-c-interop-mapping-pointer-types.md similarity index 100% rename from proposals/p6357.md rename to proposals/p006357-c-interop-mapping-pointer-types.md diff --git a/proposals/p6358.md b/proposals/p006358-c-interop-api-importing-and-semantics.md similarity index 100% rename from proposals/p6358.md rename to proposals/p006358-c-interop-api-importing-and-semantics.md diff --git a/proposals/p6395.md b/proposals/p006395-type-completeness-in-extend.md similarity index 96% rename from proposals/p6395.md rename to proposals/p006395-type-completeness-in-extend.md index 38ddef8e08c1..0caf5da567fe 100644 --- a/proposals/p6395.md +++ b/proposals/p006395-type-completeness-in-extend.md @@ -31,7 +31,7 @@ named in the declaration. ## Problem Proposal -[#5168](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p5168.md) +[#5168](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md) laid out rules for when a facet type needs to be identified or complete. When `require impls X` is written, then `X` must be identified. However it does not specify any rule for `extend require impls X`. And we lack completeness rules @@ -46,13 +46,13 @@ complete to avoid poisoning names in the entity. ## Background - Proposal - [#5168](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p5168.md): + [#5168](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md): Forward `impl` declaration of an incomplete interface - Proposal - [#2760](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p2760.md): + [#2760](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p002760-consistent-class-and-interface-syntax.md): Consistent `class` and `interface` syntax - Proposal - [#0777](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p0777.md): + [#0777](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p000777-inheritance.md): Inheritance ## Proposal diff --git a/proposals/p6641.md b/proposals/p006641-clang-irgen-in-carbon.md similarity index 100% rename from proposals/p6641.md rename to proposals/p006641-clang-irgen-in-carbon.md diff --git a/proposals/p6668.md b/proposals/p006668-c-interop-type-mapping-for-integer-and-floating-point-literals.md similarity index 97% rename from proposals/p6668.md rename to proposals/p006668-c-interop-type-mapping-for-integer-and-floating-point-literals.md index c5a07900d652..26abcf6e7edb 100644 --- a/proposals/p6668.md +++ b/proposals/p006668-c-interop-type-mapping-for-integer-and-floating-point-literals.md @@ -203,7 +203,7 @@ not the desired behavior, and so can be expected to change in the future. #### No suffixes Carbon literals have no suffix. The reasons for this are covered in -[Proposal #144's alternative "Use an ordinary integer or floating-point type for literals"](p0144.md#use-an-ordinary-integer-or-floating-point-type-for-literals). +[Proposal #144's alternative "Use an ordinary integer or floating-point type for literals"](p000144-numeric-literal-semantics.md#use-an-ordinary-integer-or-floating-point-type-for-literals). ## Proposal @@ -212,7 +212,8 @@ Carbon literals have no suffix. The reasons for this are covered in function. - **C++ literal to Carbon type**: A C++ literal will be given a C++ type following the C++ rules, which will then be mapped to a Carbon type as - defined in [primitive types mapping](p5448.md#carbon-primitive-types). + defined in + [primitive types mapping](p005448-carbon-c-interop-primitive-types.md#carbon-primitive-types). - For example, `1` becomes `int` according to C++ rules, and `int` maps to `i32` in Carbon. @@ -255,7 +256,7 @@ double, the program is ill-formed. A C++ integer literal will be given a C++ integer type following the C++ rules, which will then be mapped to a Carbon type as defined in -[primitive types mapping](p5448.md#carbon-primitive-types). +[primitive types mapping](p005448-carbon-c-interop-primitive-types.md#carbon-primitive-types). | C++ literal suffix | Carbon type with decimal C++ integer literals | Carbon type with hexadecimal, binary and octal C++ integer literals | | --------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | @@ -272,7 +273,8 @@ which will then be mapped to a Carbon type as defined in A C++ floating literal will be given a C++ type following the C++ rules, which will then be mapped to a Carbon type as defined in -[primitive types mapping](p5448.md#carbon-primitive-types). That means: +[primitive types mapping](p005448-carbon-c-interop-primitive-types.md#carbon-primitive-types). +That means: | C++ floating-point literal suffix | Carbon floating-point literal type | | --------------------------------- | ---------------------------------- | diff --git a/proposals/p6676.md b/proposals/p006676-carbon-c-interop-importing-c-c-object-like-macros.md similarity index 99% rename from proposals/p6676.md rename to proposals/p006676-carbon-c-interop-importing-c-c-object-like-macros.md index bf0e167192b7..b4c3b7157ed7 100644 --- a/proposals/p6676.md +++ b/proposals/p006676-carbon-c-interop-importing-c-c-object-like-macros.md @@ -149,7 +149,7 @@ Cpp.BUFFER_SIZE. The type of the imported constant is deduced by Clang by evaluating the constant expression and then mapped to a Carbon type following the existing -[Carbon <-> C++ type mapping rules](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p5448.md). +[Carbon <-> C++ type mapping rules](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p005448-carbon-c-interop-primitive-types.md). ### Constant value diff --git a/proposals/p6699.md b/proposals/p006699-diagnostic-sorting.md similarity index 100% rename from proposals/p6699.md rename to proposals/p006699-diagnostic-sorting.md diff --git a/proposals/p6710.md b/proposals/p006710-char-redesign.md similarity index 100% rename from proposals/p6710.md rename to proposals/p006710-char-redesign.md diff --git a/proposals/p6716.md b/proposals/p006716-move-toolchain-alternatives-to-proposals.md similarity index 100% rename from proposals/p6716.md rename to proposals/p006716-move-toolchain-alternatives-to-proposals.md diff --git a/proposals/p6902.md b/proposals/p006902-identification-of-a-named-constraint-during-definition.md similarity index 94% rename from proposals/p6902.md rename to proposals/p006902-identification-of-a-named-constraint-during-definition.md index 637842ee1ed7..218673f3c242 100644 --- a/proposals/p6902.md +++ b/proposals/p006902-identification-of-a-named-constraint-during-definition.md @@ -39,9 +39,10 @@ definition. ## Problem -Under the rules established in [Proposal #5168](/proposals/p5168.md), a facet -type is identified only if all its referenced interfaces are declared and all -its referenced named constraints are complete. +Under the rules established in +[Proposal #5168](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md), +a facet type is identified only if all its referenced interfaces are declared +and all its referenced named constraints are complete. This definition creates a circularity problem during the definition of a named constraint. If a `require impls` statement inside a named constraint definition @@ -52,8 +53,8 @@ earlier ones. ## Background -- [Proposal #5168](/proposals/p5168.md): Introduced rules for facet type - identification and completion. +- [Proposal #5168](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md): + Introduced rules for facet type identification and completion. ## Proposal @@ -76,8 +77,10 @@ The change from previous rules is that a facet type containing a named constraint is now partially identified inside the definition of that named constraint. -As in [#5168](/proposals/p5168.md), an `impl` declaration and `require` -statement each requires its constraint to be identified. +As in +[#5168](/proposals/p005168-forward-impl-declaration-of-an-incomplete-interface.md), +an `impl` declaration and `require` statement each requires its constraint to be +identified. We define the rules for facets in impl lookups, which are representable as ` as ` conversions as follows: diff --git a/proposals/p6910.md b/proposals/p006910-support-octal-literals.md similarity index 95% rename from proposals/p6910.md rename to proposals/p006910-support-octal-literals.md index 9b2245ae2333..9cc99eaf0209 100644 --- a/proposals/p6910.md +++ b/proposals/p006910-support-octal-literals.md @@ -58,9 +58,9 @@ nor are they very common in code. We also expect these to be the primary use of octal numeric literals in Carbon. Given these issues, proposal #143 -[rejected octal literals](/proposals/p0143.md#octal-literals). Now, we're -testing interoperability of POSIX file system calls, and we are considering -octal literals as a potential solution. +[rejected octal literals](/proposals/p000143-numeric-literals.md#octal-literals). +Now, we're testing interoperability of POSIX file system calls, and we are +considering octal literals as a potential solution. Proposal #143 [discussed the Carbon-style `0o` versus C++-style `0` prefix for octal literals. The same logic still applies, so we will not address it here. diff --git a/proposals/p7016.md b/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md similarity index 99% rename from proposals/p7016.md rename to proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md index cab879af5293..aa042ab53210 100644 --- a/proposals/p7016.md +++ b/proposals/p007016-updating-self-syntax-and-adding-static-member-variables.md @@ -260,7 +260,8 @@ parameters of any kind, implicit or explicit. We have generally been happy with `self` being explicit instead of implicit and so to an extent we didn't deeply consider (2) as that wasn't part of the problem we set out to solve. We're still comfortable with the rationale about this -aspect of the syntax from [p0722](/proposals/p0722.md#full-receiver-type). +aspect of the syntax from +[#722](/proposals/p000722-nominal-classes-and-methods.md#full-receiver-type). We did consider (1) but were unable to find a syntax that felt compelling. Taking a new balanced delimiter is an especially difficult and expensive choice diff --git a/proposals/scripts/BUILD b/proposals/scripts/BUILD index 6f440bc6a249..de8e47bddf73 100644 --- a/proposals/scripts/BUILD +++ b/proposals/scripts/BUILD @@ -2,12 +2,18 @@ # Exceptions. See /LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -load("@rules_python//python:defs.bzl", "py_binary", "py_test") +load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") + +py_library( + name = "utils", + srcs = ["utils.py"], +) py_binary( name = "new_proposal", srcs = ["new_proposal.py"], python_version = "PY3", + deps = [":utils"], ) py_test( @@ -18,3 +24,26 @@ py_test( python_version = "PY3", deps = [":new_proposal"], ) + +py_binary( + name = "check_proposal_names", + srcs = ["check_proposal_names.py"], + python_version = "PY3", + deps = [":utils"], +) + +py_test( + name = "utils_test", + size = "small", + srcs = ["utils_test.py"], + python_version = "PY3", + deps = [":utils"], +) + +py_test( + name = "check_proposal_names_test", + size = "small", + srcs = ["check_proposal_names_test.py"], + python_version = "PY3", + deps = [":check_proposal_names"], +) diff --git a/proposals/scripts/check_proposal_names.py b/proposals/scripts/check_proposal_names.py new file mode 100755 index 000000000000..f4769b64b8b6 --- /dev/null +++ b/proposals/scripts/check_proposal_names.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 + +"""Renames proposal files to match convention.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +import argparse +import os +import pathlib + +import re +import sys +from typing import List, Optional, Tuple + +# Add repo root to sys.path to allow importing from proposals.scripts +sys.path.append(str(pathlib.Path(__file__).resolve().parents[2])) +from proposals.scripts.utils import slugify # noqa: E402 + + +def _parse_args(args: Optional[List[str]] = None) -> argparse.Namespace: + """Parses command-line arguments.""" + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "files", + metavar="FILE", + nargs="*", + type=pathlib.Path, + default=None, + help="Specific proposals to check. If omitted, checks all proposals.", + ) + return parser.parse_args(args=args) + + +# TODO: Switch to `pathspec` once it is available as a dependency to +# correctly parse `.gitignore` and allow an unfiltered walk of the repo. +def _find_markdown_files(repo_root: pathlib.Path) -> List[pathlib.Path]: + """Finds all markdown files to update in our repository.""" + md_files = [] + # Top-level files + for f in repo_root.glob("*.md"): + md_files.append(f) + + # Top-level directories that contain markdown. We do these independently to + # avoid having to filter out ignored directories. + for dir_name in ["docs", "proposals", "toolchain"]: + dir_path = repo_root / dir_name + if dir_path.is_dir(): + md_files.extend(dir_path.glob("**/*.md")) + + return md_files + + +def _update_references( + repo_root: pathlib.Path, renames: List[Tuple[str, str]] +) -> None: + """Updates references to renamed proposals in all markdown files.""" + md_files = _find_markdown_files(repo_root) + for md_file in md_files: + with open(md_file, "r") as f: + content = f.read() + + updated_content = content + # Sort renames by length descending to avoid partial matches. + for old_name, new_name in sorted( + renames, key=lambda x: len(x[0]), reverse=True + ): + if old_name.endswith(".md"): + # File reference: replace stand-alone occurrences. + pattern = r"\b" + re.escape(old_name) + r"\b" + updated_content = re.sub(pattern, new_name, updated_content) + else: + # Directory reference: only if part of a path or has anchor. + # Case 1: followed by / or # + pattern1 = r"\b" + re.escape(old_name) + r"(?=[/#])" + updated_content = re.sub(pattern1, new_name, updated_content) + + # Case 2: preceded by / + pattern2 = r"(?<=/)" + re.escape(old_name) + r"\b" + updated_content = re.sub(pattern2, new_name, updated_content) + + if updated_content != content: + print(f"Updating references in {md_file}") + with open(md_file, "w") as f: + f.write(updated_content) + + +def _rename_proposals( + proposals_dir: pathlib.Path, files: Optional[List[pathlib.Path]] = None +) -> None: + """Renames proposal files to match convention.""" + if not files: + files = list(proposals_dir.glob("p*.md")) + + renames = [] + for path in files: + filename = path.name + + # Make sure the filename starts with `p` followed by digits, and extract + # the proposal number from those digits. + match = re.match(r"p(\d+)", filename) + if not match: + print(f"Skipping non-conforming file: {filename}") + continue + num_str = match.group(1) + num = int(num_str) + + # Read title from file + title = None + with open(path, "r") as f: + for line in f: + if line.startswith("# "): + title = line[2:].strip() + break + + if not title: + print(f"Warning: No title found in {filename}") + title = "untitled" + + slug = slugify(title) + new_filename = f"p{num:06d}-{slug}.md" + + if filename != new_filename: + renames.append((filename, new_filename)) + new_path = proposals_dir / new_filename + print(f"Renaming {filename} to {new_filename}") + os.rename(path, new_path) + + # Find any associated directory by matching the old filename without + # the `.md` extensions, or directory named with `p` and the number. + old_dir_path = None + for dir in (f for f in proposals_dir.iterdir() if f.is_dir()): + match_dir = re.match(r"^p(\d+)$", dir.name) + if dir.name == filename[:-3] or ( + match_dir and int(match_dir.group(1)) == num + ): + old_dir_path = dir + break + + if old_dir_path: + new_dir_path = proposals_dir / new_filename[:-3] + if old_dir_path != new_dir_path: + renames.append((old_dir_path.name, new_dir_path.name)) + print(f"Renaming directory {old_dir_path} to {new_dir_path}") + os.rename(old_dir_path, new_dir_path) + + if renames: + repo_root = proposals_dir.absolute().parent + _update_references(repo_root, renames) + + +def main(argv: Optional[List[str]] = None) -> None: + proposals_dir = pathlib.Path("proposals") + if not proposals_dir.is_dir(): + print("Error: proposals directory not found.") + sys.exit(1) + + args = _parse_args(argv) + _rename_proposals(proposals_dir, args.files) + + +if __name__ == "__main__": + main() diff --git a/proposals/scripts/check_proposal_names_test.py b/proposals/scripts/check_proposal_names_test.py new file mode 100644 index 000000000000..fd8bfb666d82 --- /dev/null +++ b/proposals/scripts/check_proposal_names_test.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 + +"""Tests for check_proposal_names.py.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +import os +import pathlib +import tempfile +import unittest + + +from proposals.scripts import check_proposal_names + + +class TestCheckProposalNames(unittest.TestCase): + def test_rename_file(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + proposals_dir = tmp_path / "proposals" + proposals_dir.mkdir() + + proposal_path = proposals_dir / "p1.md" + with open(proposal_path, "w") as f: + f.write("# My Proposal\n") + + check_proposal_names._rename_proposals(proposals_dir) + + self.assertTrue((proposals_dir / "p000001-my-proposal.md").exists()) + self.assertFalse(proposal_path.exists()) + + def test_rename_file_and_directory(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + proposals_dir = tmp_path / "proposals" + proposals_dir.mkdir() + + (proposals_dir / "p1").mkdir() + proposal_path = proposals_dir / "p1.md" + with open(proposal_path, "w") as f: + f.write("# My Proposal\n") + + check_proposal_names._rename_proposals(proposals_dir) + + self.assertTrue((proposals_dir / "p000001-my-proposal.md").exists()) + self.assertTrue((proposals_dir / "p000001-my-proposal").exists()) + self.assertFalse(proposal_path.exists()) + self.assertFalse((proposals_dir / "p1").exists()) + + def test_no_title(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + proposals_dir = tmp_path / "proposals" + proposals_dir.mkdir() + + proposal_path = proposals_dir / "p1.md" + with open(proposal_path, "w") as f: + f.write("No title here\n") + + check_proposal_names._rename_proposals(proposals_dir) + + self.assertTrue((proposals_dir / "p000001-untitled.md").exists()) + self.assertFalse(proposal_path.exists()) + + def test_update_references(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + proposals_dir = tmp_path / "proposals" + proposals_dir.mkdir() + + proposal_path = proposals_dir / "p1.md" + with open(proposal_path, "w") as f: + f.write("# My Proposal\n") + + # Create another markdown file referencing p1.md + ref_path = tmp_path / "README.md" + with open(ref_path, "w") as f: + f.write("See [proposal](proposals/p1.md)\n") + + # Run + check_proposal_names._rename_proposals(proposals_dir) + + # Verify + with open(ref_path, "r") as f: + content = f.read() + self.assertEqual( + content, "See [proposal](proposals/p000001-my-proposal.md)\n" + ) + + def test_update_directory_references(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + proposals_dir = tmp_path / "proposals" + proposals_dir.mkdir() + + (proposals_dir / "p1").mkdir() + proposal_path = proposals_dir / "p1.md" + with open(proposal_path, "w") as f: + f.write("# My Proposal\n") + + # Create another markdown file referencing p1 directory + ref_path = tmp_path / "README.md" + with open(ref_path, "w") as f: + f.write( + "See [dir](proposals/p1) or [file](proposals/p1.md) and " + "bare p1 in text.\n" + ) + + # Run + check_proposal_names._rename_proposals(proposals_dir) + + # Verify + with open(ref_path, "r") as f: + content = f.read() + self.assertEqual( + content, + "See [dir](proposals/p000001-my-proposal) or " + "[file](proposals/p000001-my-proposal.md) and " + "bare p1 in text.\n", + ) + + def test_relative_path_rename(self) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = pathlib.Path(tmpdir) + old_cwd = os.getcwd() + os.chdir(tmp_path) + try: + os.makedirs("proposals") + proposal_path = pathlib.Path("proposals/p1.md") + with open(proposal_path, "w") as f: + f.write("# My Proposal\n") + + check_proposal_names._rename_proposals( + pathlib.Path("proposals") + ) + + self.assertTrue( + os.path.exists("proposals/p000001-my-proposal.md") + ) + finally: + os.chdir(old_cwd) + + +if __name__ == "__main__": + unittest.main() diff --git a/proposals/scripts/new_proposal.py b/proposals/scripts/new_proposal.py index 67c93a91260f..5acc9cf9a4ab 100755 --- a/proposals/scripts/new_proposal.py +++ b/proposals/scripts/new_proposal.py @@ -22,6 +22,10 @@ import sys from pathlib import Path from typing import List, Optional +# Add repo root to sys.path to allow importing from proposals.scripts +sys.path.append(str(Path(__file__).resolve().parents[2])) +from proposals.scripts.utils import slugify # noqa: E402 + _PROMPT = """This will: - Create and switch to a new branch named '%s'. - Create a new proposal titled '%s'. @@ -252,9 +256,9 @@ def main() -> None: ] ) - # Remove the temp file, create p####.md, and fill in PR information. + # Remove the temp file, create p######-title.md, and fill in PR information. os.remove(temp_path) - final_path = "proposals/p%04d.md" % pr_num + final_path = "proposals/p%06d-%s.md" % (pr_num, slugify(title)) content = _fill_template(template_path, title, pr_num) with open(final_path, "w") as final_file: final_file.write(content) diff --git a/proposals/scripts/utils.py b/proposals/scripts/utils.py new file mode 100644 index 000000000000..7ad6dbcf03c2 --- /dev/null +++ b/proposals/scripts/utils.py @@ -0,0 +1,16 @@ +"""Shared utilities for proposal scripts.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +import re + + +def slugify(title: str) -> str: + """Returns a robust slug of the title.""" + slug = title.lower() + slug = re.sub(r"[^a-z0-9]+", "-", slug) + return slug.strip("-") diff --git a/proposals/scripts/utils_test.py b/proposals/scripts/utils_test.py new file mode 100644 index 000000000000..057ded6fba46 --- /dev/null +++ b/proposals/scripts/utils_test.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + +"""Tests for utils.py.""" + +__copyright__ = """ +Part of the Carbon Language project, under the Apache License v2.0 with LLVM +Exceptions. See /LICENSE for license information. +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +""" + +import unittest + +from proposals.scripts import utils + + +class TestUtils(unittest.TestCase): + def test_slugify(self) -> None: + self.assertEqual(utils.slugify("Hello World"), "hello-world") + self.assertEqual(utils.slugify("Hello World"), "hello-world") + self.assertEqual(utils.slugify("Hello World!"), "hello-world") + self.assertEqual(utils.slugify("123 Hello"), "123-hello") + self.assertEqual(utils.slugify("Hello-World"), "hello-world") + self.assertEqual(utils.slugify(" Hello World "), "hello-world") + self.assertEqual(utils.slugify("Hello_World"), "hello-world") + self.assertEqual(utils.slugify("Hello 🚀 World"), "hello-world") + self.assertEqual(utils.slugify("🚀 Hello"), "hello") + self.assertEqual(utils.slugify("Hello 🚀"), "hello") + self.assertEqual(utils.slugify("Hello\nWorld"), "hello-world") + self.assertEqual(utils.slugify("Hello\x01World"), "hello-world") + self.assertEqual(utils.slugify("Hello\tWorld"), "hello-world") + self.assertEqual(utils.slugify("Hello \n World"), "hello-world") + + +if __name__ == "__main__": + unittest.main() diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index c844ff5323df..7b6434540f7c 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -2298,7 +2298,7 @@ static auto LookupBuiltinName(Context& context, SemIR::LocId loc_id, const clang::ASTContext& ast_context = context.ast_context(); // List of types based on - // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p5448.md#details + // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p005448.md#details auto builtin_type = llvm::StringSwitch(*name) .Case("signed_char", ast_context.SignedCharTy) diff --git a/toolchain/check/merge.cpp b/toolchain/check/merge.cpp index 704c051b2931..1e3fed25ee5f 100644 --- a/toolchain/check/merge.cpp +++ b/toolchain/check/merge.cpp @@ -483,7 +483,7 @@ static auto CheckRedeclParamSyntax(Context& context, } if (!IsNodeSyntaxEqual(context, new_node_id, prev_node_id)) { // Skip difference if it is `Self as` vs. `as` in an `impl` declaration. - // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3763.md#redeclarations + // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p003763.md#redeclarations if (new_node_kind == Parse::NodeKind::ImplDefaultSelfAs && prev_node_kind == Parse::NodeKind::SelfTypeNameExpr && context.parse_tree().node_kind(prev_iter[1]) == diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index f046bd9d5e8c..c8b903fd78e5 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -48,7 +48,7 @@ class C { impl as Z; } -// TODO: This should typecheck (see p5366). +// TODO: This should typecheck (see #5366). // CHECK:STDERR: fail_todo_redeclaration_reenter_class.carbon:[[@LINE+12]]:9: error: expected expression [ExpectedExpr] // CHECK:STDERR: impl C.(as Z) {} // CHECK:STDERR: ^~ @@ -74,7 +74,7 @@ class C { impl Self as Z; } -// TODO: This should typecheck (see p5366). +// TODO: This should typecheck (see #5366). // CHECK:STDERR: fail_todo_redeclaration_reenter_class_explicit_self.carbon:[[@LINE+12]]:9: error: name `Self` not found [NameNotFound] // CHECK:STDERR: impl C.(Self as Z) {} // CHECK:STDERR: ^~~~ @@ -98,7 +98,7 @@ class C { impl as Z; } -// TODO: This should typecheck (see p5366). +// TODO: This should typecheck (see #5366). // CHECK:STDERR: fail_todo_redeclaration_reenter_class_mixed_self_outside.carbon:[[@LINE+12]]:9: error: name `Self` not found [NameNotFound] // CHECK:STDERR: impl C.(Self as Z) {} // CHECK:STDERR: ^~~~ @@ -122,7 +122,7 @@ class C { impl Self as Z; } -// TODO: This should typecheck (see p5366). +// TODO: This should typecheck (see #5366). // CHECK:STDERR: fail_todo_redeclaration_reenter_class_mixed_self_inside.carbon:[[@LINE+12]]:9: error: expected expression [ExpectedExpr] // CHECK:STDERR: impl C.(as Z) {} // CHECK:STDERR: ^~ diff --git a/toolchain/docs/check/README.md b/toolchain/docs/check/README.md index 1cb6a8c8bf49..6f5dc6f5b01b 100644 --- a/toolchain/docs/check/README.md +++ b/toolchain/docs/check/README.md @@ -666,4 +666,4 @@ interfere with checking later valid lines in the same function. ## Alternatives considered -- [Using a traditional AST representation](/proposals/p6716.md#using-a-traditional-ast-representation) +- [Using a traditional AST representation](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#using-a-traditional-ast-representation) diff --git a/toolchain/docs/coalesce_generic_lowering.md b/toolchain/docs/coalesce_generic_lowering.md index 46b6bc0d3029..c24f403981ec 100644 --- a/toolchain/docs/coalesce_generic_lowering.md +++ b/toolchain/docs/coalesce_generic_lowering.md @@ -115,7 +115,7 @@ quadratic pass walking all calls instructions and comparing if the `specific_id` information is equivalent. These optimizations are not currently implemented. Note that this does not -[coalesce non-specifics](/proposals/p6716.md#coalescing-duplicate-non-specific-functions). +[coalesce non-specifics](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#coalescing-duplicate-non-specific-functions). ### Canonical specific to use @@ -253,7 +253,7 @@ respectively). ## Alternatives considered -- [Coalescing in the front-end vs back-end?](/proposals/p6716.md#coalescing-in-the-front-end-vs-back-end) -- [When to do coalescing in the front-end?](/proposals/p6716.md#when-to-do-coalescing-in-the-front-end) -- [Compile-time trade-offs](/proposals/p6716.md#compile-time-trade-offs) -- [Coalescing duplicate non-specific functions](/proposals/p6716.md#coalescing-duplicate-non-specific-functions) +- [Coalescing in the front-end vs back-end?](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#coalescing-in-the-front-end-vs-back-end) +- [When to do coalescing in the front-end?](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#when-to-do-coalescing-in-the-front-end) +- [Compile-time trade-offs](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#compile-time-trade-offs) +- [Coalescing duplicate non-specific functions](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#coalescing-duplicate-non-specific-functions) diff --git a/toolchain/docs/design/clang_api.md b/toolchain/docs/design/clang_api.md index f18bc57ae004..ca200a01c6ee 100644 --- a/toolchain/docs/design/clang_api.md +++ b/toolchain/docs/design/clang_api.md @@ -201,6 +201,6 @@ approach. ## Alternatives considered -- [PR5543 More closely mimic the Clang compilation](/proposals/p6641.md#pr5543-more-closely-mimic-the-clang-compilation) -- [Status Quo with Improvements](/proposals/p6641.md#status-quo-with-improvements) -- [Upstream Clang Changes to use Phase Based Lowering](/proposals/p6641.md#upstream-clang-changes-to-use-phase-based-lowering) +- [PR5543 More closely mimic the Clang compilation](/proposals/p006641-clang-irgen-in-carbon.md#pr5543-more-closely-mimic-the-clang-compilation) +- [Status Quo with Improvements](/proposals/p006641-clang-irgen-in-carbon.md#status-quo-with-improvements) +- [Upstream Clang Changes to use Phase Based Lowering](/proposals/p006641-clang-irgen-in-carbon.md#upstream-clang-changes-to-use-phase-based-lowering) diff --git a/toolchain/docs/diagnostics.md b/toolchain/docs/diagnostics.md index 7e77eea3e425..d8c4261cf776 100644 --- a/toolchain/docs/diagnostics.md +++ b/toolchain/docs/diagnostics.md @@ -320,9 +320,9 @@ Carbon's diagnostic style aims to balance these concerns. Our style is: ## Alternatives considered -- [Don't sort diagnostics](/proposals/p6699.md#dont-sort-diagnostics) -- [Sort by line and column](/proposals/p6699.md#sort-by-line-and-column) -- [Sort by last processed token](/proposals/p6699.md#sort-by-last-processed-token) +- [Don't sort diagnostics](/proposals/p006699-diagnostic-sorting.md#dont-sort-diagnostics) +- [Sort by line and column](/proposals/p006699-diagnostic-sorting.md#sort-by-line-and-column) +- [Sort by last processed token](/proposals/p006699-diagnostic-sorting.md#sort-by-last-processed-token) ## References diff --git a/toolchain/docs/lex.md b/toolchain/docs/lex.md index 9c1ba3089535..94a6aeaa6a3e 100644 --- a/toolchain/docs/lex.md +++ b/toolchain/docs/lex.md @@ -32,4 +32,4 @@ indentation, that is not yet implemented. ## Alternatives considered -- [Bracket matching in parser](/proposals/p6716.md#bracket-matching-in-parser) +- [Bracket matching in parser](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#bracket-matching-in-parser) diff --git a/toolchain/docs/parse.md b/toolchain/docs/parse.md index 42cfc9963a47..461fb714e25c 100644 --- a/toolchain/docs/parse.md +++ b/toolchain/docs/parse.md @@ -804,4 +804,4 @@ An independent description of our approach: ## Alternatives considered -- [Restrictive parsing](/proposals/p6716.md#restrictive-parsing) +- [Restrictive parsing](/proposals/p006716-move-toolchain-alternatives-to-proposals.md#restrictive-parsing) diff --git a/utils/tree_sitter/grammar.js b/utils/tree_sitter/grammar.js index 155a289ce566..97260fced430 100644 --- a/utils/tree_sitter/grammar.js +++ b/utils/tree_sitter/grammar.js @@ -75,7 +75,7 @@ module.exports = grammar({ comment: ($) => token(seq('//', /.*/)), // NOTE: this must be before ident rule to increase its priority. - // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p2015.md#syntax + // https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p002015.md#syntax numeric_type_literal: ($) => /[iuf][1-9][0-9]*/, ident: ($) => /[A-Za-z_][A-Za-z0-9_]*/, diff --git a/website/prebuild.py b/website/prebuild.py index b6e057e58170..ea687f69544b 100755 --- a/website/prebuild.py +++ b/website/prebuild.py @@ -127,7 +127,7 @@ def label_subdir( if subdir_str == "proposals": # Use proposal numbers as part of the title and ordering. - m = re.match(r"p(\d+).md", child.name) + m = re.match(r"p(\d+)(?:-.*)?\.md", child.name) # Skip files that aren't proposals. if not m: continue