模块 模块 Nim支持用模块的概念把一个程序拆分成片段。每个模块在它自己的文件里。模块实现了 信息隐藏 和 编译隔离 。一个模块可以通过 import 语句访问另一个模块符号。 只有标记了星号(*)的顶级符号被导出: # Module A var x *, y : int proc `*` *( a , b : se...
Pre-defined integer types Pre-defined integer types These integer types are pre-defined: int the generic signed integer type; its size is platform-dependent and has the same ...
可转换关系 可转换关系 类型 a 可 隐式 转换到类型 b 如果下列算法返回真: proc isImplicitlyConvertible ( a , b : PType ): bool = if isSubtype ( a , b ) or isCovariant ( a , b ): return...
Set type Bit fields Set type The set type models the mathematical notion of a set. The set’s basetype can only be an ordinal type of a certain size, namely: int8-int16 uint8...
Imports Types Procs Source Edit A set of helpers for the POSIX module. Raw interfaces are in the other posix*.nim files. Imports posix , parsecfg , os , since Type...
可转换关系 可转换关系 类型 a 可 隐式 转换到类型 b 如果下列算法返回真: proc isImplicitlyConvertible ( a , b : PType ): bool = if isSubtype ( a , b ) or isCovariant ( a , b ): retu...
Var返回类型 未来的方向 Var返回类型 proc,转换器或迭代器可能返回一个 var 类型,这意味着返回的值是一个左值,并且可以由调用者修改: var g = 0 proc writeAccessToG (): var int = result = g writeAccessToG () = ...
Imports Types Consts Procs Templates Exports Source Edit This module contains basic operating system facilities like retrieving environment variables, working with di...
Basic usage Encoding data Decoding data URL Safe Base64 See also Procs Source Edit This module implements a base64 encoder and decoder. Unstable API. Base64 is an e...