by RaecKK · 11y ago · 0 comments
template mysum{a = @[]}(a: seq[int]): int = 0
template mysum{a}(a: seq[int]): int =
while a.low <= a.high:
a[a.low] + mysum(a[a.low + 1 .. a.high])
var x: seq[int] = @[1, 2, 3]
echo mysum(x)