Question about patterns

2022-10-28 Thread Hlaaftana
`(~x){y}` seems to mean "capture `y` as long as it is not `x`". So template foo{x = (~x){y}}(x, y: untyped) = echo "got ", astToStr(x), " and ", astToStr(y) var a = 1 var b = 2 a = b a = a b = a b = b Run outputs got a an

Question about patterns

2022-10-28 Thread EnteryName
I do understand how this pattern is evaluated: template t{0|1}(): untyped = 3 Run But I can't figure out how this one is processed: template t{x = (~x){y} and (~x){z}}(x, y, z: bool) = x = y if x: x = z var a = false b = tr