adtEnum(Shape):
String: string
Circle: tuple[x, y: int, r: int = 1]
Line: tuple[x1, y1, x2, y2: int]
...
match a:
of Circle as mut circ:
circ.r = 1000
echo circ
of String as rect:
echo rect
of Line as (mut x1, _, x2, _):
inc x1
echo a.to(Line)
else: discard
https://github.com/andreaferretti/patty
No capture
https://github.com/voidpunk/NiMatch
match expr:
res1 => do1
...