You can use the Array solution as suggested by @Cristik or you can also make use of closure returning variadic function like:
func add(_ a: T...) -> (_ b: T...) -> [T] {
return { (b: T...) -> [T] in
return zip(a, b).map { $0.0 + $0.1 }
}
}
let sum = add(1, 2,3)(4, 5, 6)
print(sum)