From 8d903372e0c41c8b7641e80feb4fe82d9f18dcb3 Mon Sep 17 00:00:00 2001 From: danakj Date: Thu, 9 Jan 2025 12:38:43 -0500 Subject: [PATCH] package scope -> file scope imports are typically in the file scope, they don't become part of the package --- proposals/p4682.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proposals/p4682.md b/proposals/p4682.md index 990b4520a5416..2045092b430c8 100644 --- a/proposals/p4682.md +++ b/proposals/p4682.md @@ -38,7 +38,7 @@ We propose to add `Core.Array(T, N)` as a library type in the `prelude` library of the `Core` package. Since arrays are a very frequent type, we propose to privilege use of this type by providing a builtin `Array(T, N)` type that resolves to the `Core.Array(T, N)` type. Users can model this as an implicit -import of the `Core.Array(T, N)` type into the package scope, much like the +import of the `Core.Array(T, N)` type into the file scope, much like the implicit import of the `prelude` library of the `Core` package. ## Problem @@ -279,8 +279,8 @@ library type, it is mostly focused on the goal This proposal aims to make code easy to understand by having the builtin forwarding name match exactly with the type in the `Core` library. This choice makes the builtin conceptually equivalent to an implicit `import` of the type -into the package scope, much like the implicit `import` of the `prelude` library -of the `Core` package, something developers will already need to model in their +into the file scope, much like the implicit `import` of the `prelude` library of +the `Core` package, something developers will already need to model in their minds when reading Carbon code. That `Array` will be provided as a compiler builtin is an implementation detail that the Carbon developer need not worry about. It could as easily be implemented as an implicit `import`. @@ -366,7 +366,7 @@ Providing just the library type is possible, but arrays will be one of the most common types in Carbon code, as described earlier. Privileging them with a shorthand that avoids `Core.` will help make Carbon code significantly more concise, due to the frequency, without hurting understandability. This makes it -worth the tradeoff of putting a name into the package scope (by way of a builtin +worth the tradeoff of putting a name into the file scope (by way of a builtin type). ### `array(T, N)`