for x in 'add+ subtract- multiply* divide/'.split() ] + [ ('remainder', '%', 'Divide', 'the remainder') ] }% Usage public protocol _IntegerArithmeticType { % for name,_,Action,result in integerBinaryOps: /// ${Action} `lhs` and `rhs`, returning ${result} and a `Bool` that is /// true iff the operation caused an arithmetic overflow. static func ${name}WithOverflow(lhs: Self, _ rhs: Self) -> (Self, overflow: Bool) % end }