tglobal.nim 401 B

1234567891011121314151617
  1. discard """
  2. output: "in globalaux2: 10\ntotal globals: 2\nint value: 100\nstring value: second"
  3. disabled: "true"
  4. """
  5. import globalaux, globalaux2
  6. echo "total globals: ", totalGlobals
  7. globalInstance[int]().val = 100
  8. echo "int value: ", globalInstance[int]().val
  9. globalInstance[string]().val = "first"
  10. globalInstance[string]().val = "second"
  11. echo "string value: ", globalInstance[string]().val