fork(2) download
  1. type
  2. L* = object
  3. hash_size: int
  4.  
  5. template init(c: var typed, hash_size: typed = 0) =
  6. if (hash_size == 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.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(12, 9) Error: identifier expected, but found '4'
stdout
Standard output is empty