By passing nil (ok, by setting the default to nil), you can get foo3() behaving 
as follows
    
    
    template foo(_: untyped): auto =
      echo "foo"
      1
    
    template foo2(_: varargs[untyped]): auto =
      echo "foo2"
      block:
        discard
      2
    
    template foo3(_: untyped = nil): auto =
      echo "foo3"
      3
    
    let x = (block:
      foo:
        discard)
    
    let y = foo2()
    
    let z = foo3()
    
    echo x
    echo y
    echo z
    
    

Reply via email to