From b5907a1eb5d30f9770bfa6466dea573529b0d1ba Mon Sep 17 00:00:00 2001 From: jonmeow Date: Thu, 20 Oct 2022 16:52:03 +0000 Subject: [PATCH 1/5] update --- docs/design/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/design/README.md b/docs/design/README.md index 9cf6b83090faf..bfaa032d7d5ef 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -2122,16 +2122,15 @@ package Geometry library "Shapes" api; Parts of this declaration may be omitted: +- If the library keyword is not specified, as in `package Geometry api;`, this + file contributes to the default library. + + - **Note:** This is provisional, no design has been through the proposal + process yet. + - If the package name is omitted, as in `package library "Main" api;`, the file contributes to the default package. No other package may import from the default package. -- If the library keyword is not specified, as in `package Geometry api;`, this - file contributes to the default library. -- If a file has no package declaration at all, it is the `api` file belonging - to the default package and default library. This is particularly for tests - and smaller examples. No other library can import this library even from - within the default package. It can be split across multiple `impl` files - using a `package impl;` package declaration. A program need not use the default package, but if it does, it should contain the entry-point function. By default, the entry-point function is `Run` from the From a918c7144f992be10d85c7450cbb79ccff0ecaef Mon Sep 17 00:00:00 2001 From: jonmeow Date: Thu, 20 Oct 2022 16:53:13 +0000 Subject: [PATCH 2/5] x --- docs/design/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/design/README.md b/docs/design/README.md index bfaa032d7d5ef..5a7a5409d76df 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -2122,15 +2122,15 @@ package Geometry library "Shapes" api; Parts of this declaration may be omitted: -- If the library keyword is not specified, as in `package Geometry api;`, this - file contributes to the default library. +- If the package name is omitted, as in `package library "Main" api;`, the + file contributes to the default package. No other package may import from + the default package. - **Note:** This is provisional, no design has been through the proposal process yet. -- If the package name is omitted, as in `package library "Main" api;`, the - file contributes to the default package. No other package may import from - the default package. +- If the library keyword is not specified, as in `package Geometry api;`, this + file contributes to the default library. A program need not use the default package, but if it does, it should contain the entry-point function. By default, the entry-point function is `Run` from the From 0195fc310bd26ed9398213ee6b645f920a008ddc Mon Sep 17 00:00:00 2001 From: jonmeow Date: Thu, 20 Oct 2022 16:54:51 +0000 Subject: [PATCH 3/5] x --- docs/design/README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/design/README.md b/docs/design/README.md index 5a7a5409d76df..96db3e46593e6 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -2126,11 +2126,20 @@ Parts of this declaration may be omitted: file contributes to the default package. No other package may import from the default package. +- If the library keyword is not specified, as in `package Geometry api;`, this + file contributes to the default library. + - **Note:** This is provisional, no design has been through the proposal process yet. -- If the library keyword is not specified, as in `package Geometry api;`, this - file contributes to the default library. +- If a file has no package declaration at all, it is the `api` file belonging + to the default package and default library. This is particularly for tests + and smaller examples. No other library can import this library even from + within the default package. It can be split across multiple `impl` files + using a `package impl;` package declaration. + + - **Note:** This is provisional, no design has been through the proposal + process yet. A program need not use the default package, but if it does, it should contain the entry-point function. By default, the entry-point function is `Run` from the From 8a66b328b5ba2b826cfc9f506cdf572457a38938 Mon Sep 17 00:00:00 2001 From: jonmeow Date: Thu, 20 Oct 2022 17:03:48 +0000 Subject: [PATCH 4/5] link --- docs/design/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/design/README.md b/docs/design/README.md index 96db3e46593e6..3182c4d59b417 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -2103,6 +2103,11 @@ to coordinate to avoid name conflicts, but not across packages. ### Package declaration +> **Note:** This is provisional, designs for a default package, making the +> package name optional, and omitting the `package` declaration have not been +> through the proposal process yet. See +> [#2323](https://github.com/carbon-language/carbon-lang/issues/2323). + Files start with an optional package declaration, consisting of: - the `package` keyword introducer, @@ -2129,18 +2134,12 @@ Parts of this declaration may be omitted: - If the library keyword is not specified, as in `package Geometry api;`, this file contributes to the default library. - - **Note:** This is provisional, no design has been through the proposal - process yet. - - If a file has no package declaration at all, it is the `api` file belonging to the default package and default library. This is particularly for tests and smaller examples. No other library can import this library even from within the default package. It can be split across multiple `impl` files using a `package impl;` package declaration. - - **Note:** This is provisional, no design has been through the proposal - process yet. - A program need not use the default package, but if it does, it should contain the entry-point function. By default, the entry-point function is `Run` from the default package. @@ -2153,6 +2152,10 @@ default package. ### Imports +> **Note:** This is provisional, designs for making the package name optional +> have not been through the proposal process yet. See +> [#2323](https://github.com/carbon-language/carbon-lang/issues/2323). + After the package declaration, files may include `import` declarations. These include the package name and optionally `library` followed by the library name. If the library is omitted, the default library for that package is imported. From 999bb1a0ec12e66aa482c001ad9738a938a3b4a6 Mon Sep 17 00:00:00 2001 From: jonmeow Date: Thu, 20 Oct 2022 21:47:44 +0000 Subject: [PATCH 5/5] 2001 --- docs/design/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/design/README.md b/docs/design/README.md index 3182c4d59b417..418a3b57d3ccc 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -2154,7 +2154,7 @@ default package. > **Note:** This is provisional, designs for making the package name optional > have not been through the proposal process yet. See -> [#2323](https://github.com/carbon-language/carbon-lang/issues/2323). +> [#2001](https://github.com/carbon-language/carbon-lang/issues/2001). After the package declaration, files may include `import` declarations. These include the package name and optionally `library` followed by the library name.