💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[warning] 定义:模块 所有的Haxe代码组织在模块中,使用路径定位。本质上讲,每个.hx 文件表示一个模块,其中可能包含多个类型。一个类型可以是私有的,只有它的包含模块才能访问。 >[warning] Definition: Module All Haxe code is organized in modules, which are addressed using paths. In essence, each .hx file represents a module which may contain several types. A type may be private, in which case only its containing module can access it. 模块和它的同名包含类型之间的区别在设计上是模糊的。事实上,定位 haxe.ds.StringMap<Int> 可以认为是 haxe.ds.StringMap.StringMap<Int>的简短写法。后者由四部分组成: > The distinction of a module and its containing type of the same name is blurry by design. In fact, addressing haxe.ds.StringMap<Int> can be considered shorthand for haxe.ds.StringMap.StringMap<Int>. The latter version consists of four parts: * 包 haxe.ds * 模块名 StringMap * 类型名StringMap * 类型参数 Int > * the package haxe.ds > * the module name StringMap > * the type name StringMap > * the type parameter Int 如果模块和类型名是相同的,重复的部分可以被移除,使用 haxe.ds.StringMap<Int>作为简短版本。然而,了解扩展的版本帮助我们理解模块子类型(第3.7.1)如何定位。 > If the module and type name are equal,the duplicate can be removed,leading to the haxe.ds.StringMap<Int> short version. However, knowing about the extended version helps with understanding how module sub-types (3.7.1) are addressed. 路径可以被进一步简化通过 使用 import(第3.7.2节),通常允许省略路径的包部分。这可能导致不受限的标识符,而理解解析顺序(第3.7.3节)是必要的。 > Paths can be shortened further by using an import(3.7.2), which typically allows omitting the package part of a path. This may lead to usage of unqualified identifiers, for which understanding the resolution order (3.7.3) is required. **类型路径** >[warning] 定义:类型路径 类型的点路径由包,模块名和类型名组成。它的通常格式是 pack1.paceN.ModuleName.TypeName 。 >[warning] Definition: Type path The (dot-)path to a type consists of the package, the module name and the type name. Its general form is pack1.pack2.packN.ModuleName.TypeName.