• 导出标记

    导出标记

    如果声明的符号标有 asterisk 它从当前模块导出:

    1. proc exportedEcho*(s: string) = echo s
    2. proc `*`*(a: string; b: int): string =
    3. result = newStringOfCap(a.len * b)
    4. for i in 1..b: result.add a
    5.  
    6. var exportedVar*: int
    7. const exportedConst* = 78
    8. type
    9. ExportedType* = object
    10. exportedField*: int