What I need is the equivalent of Maple's zip(+, A, B, 0).
Sure I can get it with:
Thread[PadRight[A, max = Max[Length[A], Length[B]]] + PadRight[B, max]]
But is there a less verbose way to do this?
P.S. Eventually the shortest solution seems to be:
Plus @@ PadRight[{A, B}]
Threadis useless (becausePlusis Listable) andPadRight[A, max = Max[Length[A], Length[B]]] + PadRight[B, max]can be rewritten asPlus @@ PadRight[{A,B}]– andre314 Jan 29 '14 at 19:30