Julia 中文文档。Julia 的包加载机制不要求包名称是全局唯一的, 即使在单个项目的依赖关系图中也是如此。相反,包由通用唯一标识符 (UUID)进行标识,它在每 个包创建时进行分配。通常,您不必直接使用这些有点麻烦的 128 位标识符,因为 Pkg 将负责生成 和跟踪它们。但是,这些 UUID 为问题「X 所指的包是什么?」提供了确定的答案 由于去中心化的命名问题有些抽象,因此可以通过具体情境来理解问题。假设你正在开发一个名为 继续正常工作依赖于他们两者,因此表达式 import Priv 必须引用不同的 Priv 包, 具体取决于它是出现在 App 的代码中还是出现在 Pub 的代码中。为了处理这种情况,Julia 的包加载 机制通过 UUID 区分两个 Priv 包并根据它(调用 import 的模块)的上下文选择正确的包。这种区分 的工作原理取决于环境,如以下各节所述。 29.3 环境(Environments) 环境决定了 import name::Symbol ⟶ uuid::UUID 环境的 roots 映射将包名称分配给 UUID,以获取环境可用于主项目的所有顶级依赖项(即可 以在 Main 中加载的那些依赖项)。当 Julia 在主项目中遇到 import X 时,它会将 X 的标识作为 roots[:X]。 • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID 环境的 graph0 码力 | 1238 页 | 4.59 MB | 1 年前3
Julia v1.6.6 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1324 页 | 4.54 MB | 1 年前3
Julia 1.6.5 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1325 页 | 4.54 MB | 1 年前3
Julia 1.6.7 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1324 页 | 4.54 MB | 1 年前3
Julia 1.6.1 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1397 页 | 4.59 MB | 1 年前3
Julia 1.6.4 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1324 页 | 4.54 MB | 1 年前3
Julia 1.6.2 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1324 页 | 4.54 MB | 1 年前3
Julia 1.6.0 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1397 页 | 4.59 MB | 1 年前3
Julia 1.6.3 Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1325 页 | 4.54 MB | 1 年前3
Julia 1.6.0 DEV Documentationcode. To handle this, Julia's package loading mechanism distinguishes the two Priv packages by their UUID and picks the correct one based on its context (the module that called import). How this distinction locate the source code of X. The specific roles of the three maps are: • roots: name::Symbol ⟶ uuid::UUID An environment's roots map assigns package names to UUIDs for all the top-level dependencies that identity of X as roots[:X]. • graph: context::UUID ⟶ name::Symbol ⟶ uuid::UUID An environment's graph is a multilevel map which assigns, for each context UUID, a map from names to UUIDs, similar to the0 码力 | 1383 页 | 4.56 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













