fork download
  1. type
  2. Node = ref object
  3. children: seq[string]
  4.  
  5. proc main =
  6. var b = Node(children: newSeq[string](1))
  7. echo "b:", b.repr
  8.  
  9. b.children[0] = "Hello World"
  10. echo "b:", b.repr
  11.  
  12. main()
Success #stdin #stdout 0s 2424KB
stdin
Standard input is empty
stdout
b:ref 0xb75dd028 --> [children = 0xb75de028[nil]]

b:ref 0xb75dd028 --> [children = 0xb75de028[0xb75e1168"Hello World"]]