|
|
@@ -39,7 +39,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
- [Package and library name conflicts](#package-and-library-name-conflicts)
|
|
|
- [Potential refactorings](#potential-refactorings)
|
|
|
- [Update imports](#update-imports)
|
|
|
- - [Between `api` and `impl` files](#between-api-and-impl-files)
|
|
|
+ - [Between API and implementation files](#between-api-and-implementation-files)
|
|
|
- [Other refactorings](#other-refactorings)
|
|
|
- [Preference for few child namespaces](#preference-for-few-child-namespaces)
|
|
|
- [Redundant markers](#redundant-markers)
|
|
|
@@ -107,7 +107,7 @@ _libraries_<sup><small>[[define](/docs/guides/glossary.md#library)]</small></sup
|
|
|
can be written containing pieces of the program:
|
|
|
|
|
|
```
|
|
|
-library "Colors" api;
|
|
|
+library "Colors";
|
|
|
|
|
|
choice Color { Red, Green, Blue }
|
|
|
|
|
|
@@ -115,7 +115,7 @@ fn ColorName(c: Color) -> String;
|
|
|
```
|
|
|
|
|
|
```
|
|
|
-library "Colors" impl;
|
|
|
+impl library "Colors";
|
|
|
|
|
|
fn ColorName(c: Color) -> String {
|
|
|
match (c) {
|
|
|
@@ -139,11 +139,11 @@ A library is the basic unit of _dependency_. Separating code into multiple
|
|
|
libraries can speed up the overall build while also making it clear which code
|
|
|
is being reused.
|
|
|
|
|
|
-A library has a single `api` file which defines its interface, plus zero or more
|
|
|
-`impl` files that can provide any implementation details that were omitted from
|
|
|
-the `api` file. These files are distinguished by the `library` declaration
|
|
|
-ending with `api;` or `impl;`. By convention, implementation files also use a
|
|
|
-file extension of `.impl.carbon`.
|
|
|
+A library has a single API file which defines its interface, plus zero or more
|
|
|
+implementation files that can provide any implementation details that were
|
|
|
+omitted from the API file. These files are distinguished by whether the
|
|
|
+`library` declaration starts with the `impl` modifier. By convention,
|
|
|
+implementation files also use a file extension of `.impl.carbon`.
|
|
|
|
|
|
Separating a library into interface and implementation may help organize code as
|
|
|
a library grows, or to let the build system distinguish between the dependencies
|
|
|
@@ -168,15 +168,15 @@ single identifier, such as `Geometry`. An example API file in the `Geometry`
|
|
|
package would start with:
|
|
|
|
|
|
```
|
|
|
-package Geometry api;
|
|
|
+package Geometry;
|
|
|
```
|
|
|
|
|
|
-A tiny package may consist of a single library with a single `api` file. As with
|
|
|
+A tiny package may consist of a single library with a single API file. As with
|
|
|
libraries, additional implementation files can be added to the package by using
|
|
|
the `impl` keyword in the package declaration:
|
|
|
|
|
|
```
|
|
|
-package Geometry impl;
|
|
|
+impl package Geometry;
|
|
|
```
|
|
|
|
|
|
However, as a package adds more files, it will probably want to separate out
|
|
|
@@ -187,7 +187,7 @@ the `Main` package. For example, an API file adding the library `Shapes` to the
|
|
|
[shorthand](#shorthand-notation-for-libraries-in-packages), would start with:
|
|
|
|
|
|
```
|
|
|
-package Geometry library "Shapes" api;
|
|
|
+package Geometry library "Shapes";
|
|
|
```
|
|
|
|
|
|
This library can be imported within the same package by using:
|
|
|
@@ -213,7 +213,7 @@ package. Names declared within this package can be found as members of the name
|
|
|
this syntax, and if omitted, the default (unnamed) library is imported.
|
|
|
|
|
|
```
|
|
|
-// Imports the source file beginning `package Geometry api;`
|
|
|
+// Imports the source file beginning `package Geometry;`
|
|
|
import Geometry;
|
|
|
```
|
|
|
|
|
|
@@ -239,7 +239,7 @@ defines `Circle` then the name path will be `Geometry.Circle`. However, it can
|
|
|
be named `Geometry.TwoDimensional.Circle` with a `namespace`; for example:
|
|
|
|
|
|
```
|
|
|
-package Geometry library "Shapes" api;
|
|
|
+package Geometry library "Shapes";
|
|
|
namespace TwoDimensional;
|
|
|
struct TwoDimensional.Circle { ... };
|
|
|
```
|
|
|
@@ -310,49 +310,50 @@ The `package` directive's syntax may be loosely expressed as a regular
|
|
|
expression:
|
|
|
|
|
|
```regex
|
|
|
-package IDENTIFIER (library STRING)? (api|impl);
|
|
|
+(impl)? package IDENTIFIER (library STRING)?;
|
|
|
```
|
|
|
|
|
|
For example:
|
|
|
|
|
|
```carbon
|
|
|
-package Geometry library "Objects/FourSides" api;
|
|
|
+impl package Geometry library "Objects/FourSides";
|
|
|
```
|
|
|
|
|
|
Breaking this apart:
|
|
|
|
|
|
-- The identifier passed to the `package` keyword, `Geometry`, is the package
|
|
|
- name and will prefix both library and namespace paths.
|
|
|
+- The use of the `impl` keyword indicates this is an implementation files as
|
|
|
+ described under [libraries](#libraries). If it were omitted, this would
|
|
|
+ instead be an API file.
|
|
|
+- The identifier after the `package` keyword, `Geometry`, is the package name
|
|
|
+ and will prefix both library and namespace paths.
|
|
|
- The `package` keyword also declares a package entity matching the
|
|
|
package name. A package entity is almost identical to a namespace
|
|
|
- entity, except with some package/import-specific handling. In other
|
|
|
- words, if the file declares `struct Line`, that may be used from within
|
|
|
- the file as both `Line` directly and `Geometry.TwoDimensional.Line`
|
|
|
+ entity, except with some package/import-specific handling. For example,
|
|
|
+ if the file declares `namespace TwoDimensional;` and
|
|
|
+ `struct TwoDimensional.Line`, the struct may be used from files in other
|
|
|
+ packages that import the library as `Geometry.TwoDimensional.Line`,
|
|
|
using the `Geometry` package entity created by the `package` keyword.
|
|
|
- `Main` is invalid for use as the package name. `Main` libraries must be
|
|
|
defined by either the [`library` directive](#library-directives) or the
|
|
|
[`Main//default`](#maindefault) rule.
|
|
|
-- When the optional `library` keyword is specified, sets the name of the
|
|
|
- library within the package. In this example, the
|
|
|
- `Geometry//Objects/FourSides` library will be used.
|
|
|
- - If the `library` portion is omitted, the file is implicitly part of the
|
|
|
- default library, which does not have a string name.
|
|
|
-- The use of the `api` keyword indicates this is an API files as described
|
|
|
- under [libraries](#libraries). If it instead had `impl`, this would be an
|
|
|
- implementation file.
|
|
|
+- The string after the `library` keyword sets the name of the library within
|
|
|
+ the package. In this example, the `Geometry//Objects/FourSides` library will
|
|
|
+ be used.
|
|
|
+ - If the `library` portion were omitted, the file would implicitly be part
|
|
|
+ of the default library, which does not have a string name.
|
|
|
|
|
|
#### `library` directives
|
|
|
|
|
|
The syntax for `library` directives is the same, without the `package` portion:
|
|
|
|
|
|
```regex
|
|
|
-library STRING (api|impl);
|
|
|
+(impl)? library STRING;
|
|
|
```
|
|
|
|
|
|
For example:
|
|
|
|
|
|
```carbon
|
|
|
-library "PrimeGenerator" impl;
|
|
|
+impl library "PrimeGenerator";
|
|
|
```
|
|
|
|
|
|
If the `library` directive is used, the file is implicitly part of the `Main`
|
|
|
@@ -361,7 +362,7 @@ package, whose name cannot be written explicitly.
|
|
|
#### `Main//default`
|
|
|
|
|
|
If neither a `package` directive nor a `library` directive is provided, the file
|
|
|
-is an `api` file for `Main//default`. An `impl` cannot be provided for
|
|
|
+is an API file for `Main//default`. An `impl` cannot be provided for
|
|
|
`Main//default`.
|
|
|
|
|
|
#### Files and libraries
|
|
|
@@ -377,8 +378,7 @@ path consists of only the package name. There is no "global" namespace.
|
|
|
- Entities within a file may be defined in [child namespaces](#namespaces).
|
|
|
|
|
|
Files contributing to the `Geometry//Objects/FourSides` library must all start
|
|
|
-with `package Geometry library "Objects/FourSides"`, but will differ on
|
|
|
-`api`/`impl` types.
|
|
|
+with [`impl`] `package` `Geometry` `library` `"Objects/FourSides"` `;`.
|
|
|
|
|
|
#### Shorthand notation for libraries in packages
|
|
|
|
|
|
@@ -419,8 +419,8 @@ Every Carbon library consists of one or more files. Each Carbon library has a
|
|
|
primary file that defines its API, and may optionally contain additional files
|
|
|
that are implementation.
|
|
|
|
|
|
-- An API file's `package` directive will have `api`. For example,
|
|
|
- `package Geometry library "Shapes" api;`
|
|
|
+- An API file's `package` directive does not include the `impl` modifier. For
|
|
|
+ example, `package Geometry library "Shapes";`
|
|
|
- API filenames must have the `.carbon` extension. They must not have a
|
|
|
`.impl.carbon` extension.
|
|
|
- API file paths will correspond to the library name.
|
|
|
@@ -428,13 +428,13 @@ that are implementation.
|
|
|
be expected to be similar to a "Math/Algebra" library being in a
|
|
|
"Math/Algebra.carbon" file path.
|
|
|
- The package will not be used when considering the file path.
|
|
|
-- An implementation file's `package` directive will have `impl`. For example,
|
|
|
- `package Geometry library "Shapes" impl;`.
|
|
|
+- An implementation file's `package` directive includes an `impl` modifier.
|
|
|
+ For example, `impl package Geometry library "Shapes";`.
|
|
|
- Implementation filenames must have the `.impl.carbon` extension.
|
|
|
- Implementation file paths need not correspond to the library name.
|
|
|
- Implementation files implicitly import the library's API. Implementation
|
|
|
- files cannot import each other. There is no facility for file or
|
|
|
- non-`api` imports.
|
|
|
+ files cannot import each other. There is no facility for file or non-API
|
|
|
+ imports.
|
|
|
|
|
|
The difference between API and implementation will act as a form of access
|
|
|
control. API files must compile independently of implementation, only importing
|
|
|
@@ -459,21 +459,19 @@ may be marked as `private` to indicate they should only be visible to other
|
|
|
parts of the library.
|
|
|
|
|
|
```carbon
|
|
|
-package Geometry library "Shapes" api;
|
|
|
+package Geometry library "Shapes";
|
|
|
|
|
|
-// Circle is an API, and will be available to other libraries as
|
|
|
- Geometry.Circle.
|
|
|
+// Circle is part of the public API of the library, and will be available to
|
|
|
+// other libraries as Geometry.Circle.
|
|
|
struct Circle { ... }
|
|
|
|
|
|
// CircleHelper is private, and so will not be available to other libraries.
|
|
|
private fn CircleHelper(circle: Circle) { ... }
|
|
|
|
|
|
-// Only entities in namespaces should be marked as an API, not the namespace
|
|
|
-// itself.
|
|
|
namespace Operations;
|
|
|
|
|
|
-// Operations.GetCircumference is an API, and will be available to
|
|
|
-// other libraries as Geometry.Operations.GetCircumference.
|
|
|
+// Operations.GetCircumference is part of the public API of the library, and
|
|
|
+// will be available to other libraries as Geometry.Operations.GetCircumference.
|
|
|
fn Operations.GetCircumference(circle: Circle) { ... }
|
|
|
```
|
|
|
|
|
|
@@ -488,15 +486,16 @@ However, separate implementation files are still desirable for a few reasons:
|
|
|
- From a code maintenance perspective, having smaller files can make a library
|
|
|
more maintainable.
|
|
|
|
|
|
-Entities in the `impl` file should never have visibility keywords. If they are
|
|
|
-forward declared in the `api` file, they use the declaration's visibility; if
|
|
|
-they are only present in the `impl` file, they are implicitly `private`.
|
|
|
+Entities in an implementation file should never have visibility keywords. If
|
|
|
+they are forward declared in the API file, they use the declaration's
|
|
|
+visibility; if they are only present in an implementation file, they are
|
|
|
+implicitly `private`.
|
|
|
|
|
|
#### Granularity of libraries
|
|
|
|
|
|
-The compilation graph of Carbon will generally consist of `api` files depending
|
|
|
-on each other, and `impl` files depending only on `api` files. Compiling a given
|
|
|
-file requires compiling the transitive closure of `api` files first.
|
|
|
+The compilation graph of Carbon will generally consist of API files depending on
|
|
|
+each other, and implementation files depending only on API files. Compiling a
|
|
|
+given file requires compiling the transitive closure of API files first.
|
|
|
Parallelization of compilation is then limited by how large that transitive
|
|
|
closure is, in terms of total volume of code rather than quantity. This also
|
|
|
affects build cache invalidation.
|
|
|
@@ -504,16 +503,15 @@ affects build cache invalidation.
|
|
|
In order to maximize opportunities to improve compilation performance, we will
|
|
|
encourage granular libraries. Conceptually, we want libraries to be very small,
|
|
|
possibly containing only a single class. The choice of only allowing a single
|
|
|
-`api` file per library should help encourage developers to write small
|
|
|
-libraries.
|
|
|
+API file per library should help encourage developers to write small libraries.
|
|
|
|
|
|
#### Exporting namespaces
|
|
|
|
|
|
-A namespace declared in an `api` file is only exported if it contains at least
|
|
|
-one `public` non-namespace name. For example, given this code:
|
|
|
+A namespace declared in an API file is only exported if it contains at least one
|
|
|
+`public` non-namespace name. For example, given this code:
|
|
|
|
|
|
```carbon
|
|
|
-package Checksums library "Sha" api;
|
|
|
+package Checksums library "Sha";
|
|
|
|
|
|
namespace Sha256;
|
|
|
namespace ImplementationDetails;
|
|
|
@@ -525,7 +523,7 @@ fn Sha256.HexDigest(data: Bytes) -> String { ... }
|
|
|
Calling code may look like:
|
|
|
|
|
|
```carbon
|
|
|
-package Caller api;
|
|
|
+package Caller;
|
|
|
|
|
|
import Checksums library "Sha";
|
|
|
|
|
|
@@ -564,7 +562,7 @@ entities may be [aliased](/docs/design/aliases.md) if desired.
|
|
|
For example, given a library:
|
|
|
|
|
|
```carbon
|
|
|
-package Math api;
|
|
|
+package Math;
|
|
|
namespace Trigonometry;
|
|
|
fn Trigonometry.Sin(...);
|
|
|
```
|
|
|
@@ -572,7 +570,7 @@ fn Trigonometry.Sin(...);
|
|
|
Calling code would import it and use it like:
|
|
|
|
|
|
```carbon
|
|
|
-package Geometry api;
|
|
|
+package Geometry;
|
|
|
|
|
|
import Math;
|
|
|
|
|
|
@@ -591,8 +589,8 @@ import Math;
|
|
|
import Math library "Trigonometry";
|
|
|
```
|
|
|
|
|
|
-NOTE: A library must never import itself. Any `impl` files in a library
|
|
|
-automatically import the `api`, so a self-import should never be required.
|
|
|
+NOTE: A library must never import itself. Any implementation files in a library
|
|
|
+automatically import the API, so a self-import should never be required.
|
|
|
|
|
|
#### Imports from the current package
|
|
|
|
|
|
@@ -607,7 +605,7 @@ namespace.
|
|
|
For example:
|
|
|
|
|
|
```carbon
|
|
|
-package Geometry api;
|
|
|
+package Geometry;
|
|
|
|
|
|
// This is required even though it's still in the Geometry package.
|
|
|
import library "Shapes";
|
|
|
@@ -660,7 +658,7 @@ For example, if the `Geometry//Shapes/ThreeSides` library provides the
|
|
|
`Geometry.Shapes` namespace, this code is still valid:
|
|
|
|
|
|
```carbon
|
|
|
-package Geometry library "Shapes/FourSides" api;
|
|
|
+package Geometry library "Shapes/FourSides";
|
|
|
|
|
|
import library "Shapes/ThreeSides";
|
|
|
|
|
|
@@ -781,56 +779,58 @@ check build dependencies for where imports should be added from, such as a
|
|
|
database of possible entities and their libraries. However, adding references
|
|
|
may require manually adding imports.
|
|
|
|
|
|
-#### Between `api` and `impl` files
|
|
|
+#### Between API and implementation files
|
|
|
|
|
|
-- Move an implementation of an API from an `api` file to an `impl` file, while
|
|
|
- leaving a declaration behind.
|
|
|
+- Move the definition of an entity from an API file to an implementation file,
|
|
|
+ while leaving a declaration behind.
|
|
|
|
|
|
- This should be a local change that will not affect any calling code.
|
|
|
- Inlining will be affected because the implementation won't be visible to
|
|
|
callers.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Split an `api` and `impl` file.
|
|
|
+- Split an API and implementation file.
|
|
|
|
|
|
- This is a repeated operation of individual API moves, as noted above.
|
|
|
|
|
|
-- Move an implementation of an API from an `impl` file to an `api` file.
|
|
|
+- Move the definition of an entity from an implementation file to the API
|
|
|
+ file.
|
|
|
|
|
|
- This should be a local change that will not affect any calling code.
|
|
|
- Inlining will be affected because the implementation becomes visible to
|
|
|
callers.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Combine an `api` and `impl` file.
|
|
|
+- Combine an API and implementation file.
|
|
|
|
|
|
- This is a repeated operation of individual API moves, as noted above.
|
|
|
|
|
|
-- Remove the `api` label from a declaration.
|
|
|
+- Add the `private` modifier to a declaration.
|
|
|
|
|
|
- Search for library-external callers, and fix them first.
|
|
|
|
|
|
-- Add the `api` label to a declaration.
|
|
|
+- Remove the `private` modifier from a declaration.
|
|
|
|
|
|
- This should be a local change that will not affect any calling code.
|
|
|
|
|
|
-- Move a non-`api`-labeled declaration from an `api` file to an `impl` file.
|
|
|
+- Move a `private` declaration from the API file to an implementation file.
|
|
|
|
|
|
- - The declaration must be moved to the same file as the implementation of
|
|
|
- the declaration.
|
|
|
- - The declaration can only be used by the `impl` file that now contains
|
|
|
- it. Search for other callers within the library, and fix them first.
|
|
|
+ - The declaration must be moved to the same file as the definition of the
|
|
|
+ entity.
|
|
|
+ - The declaration can only be used by the implementation file that now
|
|
|
+ contains it. Search for other callers within the library, and fix them
|
|
|
+ first.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Move a non-`api`-labeled declaration from an `impl` file to an `api` file.
|
|
|
+- Move a `private` declaration from an implementation file to the API file.
|
|
|
|
|
|
- This should be a local change that will not affect any calling code.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Move a declaration and implementation from one `impl` file to another.
|
|
|
+- Move a declaration and definition from one implementation file to another.
|
|
|
|
|
|
- - Search for any callers within the source `impl` file, and either move
|
|
|
- them too, or fix them first.
|
|
|
+ - Search for any callers within the source implementation file, and either
|
|
|
+ move them too, or fix them first.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
#### Other refactorings
|
|
|
@@ -841,15 +841,14 @@ may require manually adding imports.
|
|
|
- All call sites must be changed, as the package name changes.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Move an `api`-labeled declaration and implementation between different
|
|
|
- packages.
|
|
|
+- Move a public declaration and definition between different packages.
|
|
|
|
|
|
- The imports of all calling files must be updated accordingly.
|
|
|
- All call sites must be changed, as the package name changes.
|
|
|
- [Update imports](#update-imports).
|
|
|
|
|
|
-- Move an `api`-labeled declaration and implementation between libraries in
|
|
|
- the same package.
|
|
|
+- Move a public declaration and definition between libraries in the same
|
|
|
+ package.
|
|
|
|
|
|
- The imports of all calling files must be updated accordingly.
|
|
|
- As long as the namespaces remain the same, no call sites will need to be
|
|
|
@@ -858,20 +857,19 @@ may require manually adding imports.
|
|
|
|
|
|
- Rename a library.
|
|
|
|
|
|
- - This is equivalent to a repeated operation of moving an `api`-labeled
|
|
|
- declaration and implementation between libraries in the same package.
|
|
|
+ - This is equivalent to a repeated operation of moving a public
|
|
|
+ declaration and definition between libraries in the same package.
|
|
|
|
|
|
-- Move a declaration and implementation from one namespace to another.
|
|
|
+- Move a declaration and definition from one namespace to another.
|
|
|
|
|
|
- - Ensure the new namespace is declared for the declaration and
|
|
|
- implementation.
|
|
|
+ - Ensure the new namespace is declared for the declaration and definition.
|
|
|
- Update the namespace used by call sites.
|
|
|
- The imports of all calling files may remain the same.
|
|
|
|
|
|
- Rename a namespace.
|
|
|
|
|
|
- This is equivalent to a repeated operation of moving a declaration and
|
|
|
- implementation from one namespace to another.
|
|
|
+ definition from one namespace to another.
|
|
|
|
|
|
- Rename a file, or move a file between directories.
|
|
|
|
|
|
@@ -901,21 +899,21 @@ fewer namespaces.
|
|
|
|
|
|
We use a few possibly redundant markers for packages and libraries:
|
|
|
|
|
|
-- The `package` keyword requires one of `api` and `impl`, rather than
|
|
|
- excluding either or both.
|
|
|
-- The filename repeats the `api` versus `impl` choice.
|
|
|
+- The filename and the presence or absence of the `impl` keyword duplicate the
|
|
|
+ API versus implementation choice.
|
|
|
+- The filename and the library name portion of the package declaration
|
|
|
+ duplicate the name of the library.
|
|
|
- The `import` keyword requires the full library.
|
|
|
|
|
|
These choices are made to assist human readability and tooling:
|
|
|
|
|
|
- Being explicit about imports creates the opportunity to generate build
|
|
|
dependencies from files, rather than having them maintained separately.
|
|
|
-- Being explicit about `api` versus `impl` makes it easier for both humans and
|
|
|
- tooling to determine what to expect.
|
|
|
-- Repeating the type in the filename makes it possible to check the type
|
|
|
- without reading file content.
|
|
|
-- Repeating the type in the file content makes non-file-system-based builds
|
|
|
- possible.
|
|
|
+- Being explicit about API versus implementation in the filename makes it
|
|
|
+ easier for both humans and tooling to determine what to expect, and makes it
|
|
|
+ possible to check the type without reading file content.
|
|
|
+- Repeating the type and library name in the file content makes
|
|
|
+ non-file-system-based builds possible.
|
|
|
|
|
|
## Open questions
|
|
|
|
|
|
@@ -972,8 +970,8 @@ import Carbon library "Utilities"
|
|
|
|
|
|
### Test file type
|
|
|
|
|
|
-Similar to `api` and `impl`, we may eventually want a type like `test`. This
|
|
|
-should be part of a larger testing plan.
|
|
|
+Similar to API and implementation files, we may eventually want test-specific
|
|
|
+files. This should be part of a larger testing plan.
|
|
|
|
|
|
## Alternatives considered
|
|
|
|
|
|
@@ -989,7 +987,7 @@ should be part of a larger testing plan.
|
|
|
- [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 `Main//default impl` instead of `Main//default api`](/proposals/p3403.md#default-to-maindefault-impl-instead-of-maindefault-api)
|
|
|
+ - [Default to an implementation file for `Main//default` instead of an API file](/proposals/p3403.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)
|
|
|
@@ -1000,9 +998,10 @@ should be part of a larger testing plan.
|
|
|
- [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 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)
|
|
|
@@ -1010,6 +1009,8 @@ should be part of a larger testing plan.
|
|
|
- [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)
|
|
|
- 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)
|
|
|
@@ -1034,3 +1035,5 @@ should be part of a larger testing plan.
|
|
|
[#3403: Change Main//default to an api file](https://github.com/carbon-language/carbon-lang/pull/3403)
|
|
|
- Proposal
|
|
|
[#3453: Clarify name bindings in namespaces.](https://github.com/carbon-language/carbon-lang/pull/3407)
|
|
|
+- Proposal
|
|
|
+ [#3927: More consistent package syntax](https://github.com/carbon-language/carbon-lang/pull/3927)
|