fork download
  1. type
  2. L* = object
  3. hash_size: int
  4.  
  5. template init(c: var typed, hash: int = 0) =
  6. if (hash == 0):
  7. c.hash_size = 111
  8. else:
  9. c.hash_size = 123
  10.  
  11. var c: L
  12. init(c, 4)
  13. echo(repr c)
  14.  
  15. echo "ok"
  16.  
Success #stdin #stdout 0s 6964KB
stdin
Standard input is empty
stdout
[hash_size = 123]

ok