mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
17 lines
402 B
Nim
17 lines
402 B
Nim
discard """
|
|
file: "toop1.nim"
|
|
output: "in globalaux2: 10\ntotal globals: 2\nint value: 100\nstring value: second"
|
|
"""
|
|
|
|
import globalaux, globalaux2
|
|
|
|
echo "total globals: ", totalGlobals
|
|
|
|
globalInstance[int]().val = 100
|
|
echo "int value: ", globalInstance[int]().val
|
|
|
|
globalInstance[string]().val = "first"
|
|
globalInstance[string]().val = "second"
|
|
echo "string value: ", globalInstance[string]().val
|
|
|