I would like to define an distributive function like this:
com[x__Plus, y_] := c @@@ Distribute[c[x, y]];
which is Ok. I know that it's possible to define it simply exploiting the fact that Plus
is Flat
, but consider what I wrote just as a toy model of a more refined example.
Here the point is that I cannot write
com[x__Plus, y_] := Distribute[com[x, y]];
since I would have an infinite recursion. But is there a way to obtain the result I got in the first example without using that trick, just with Hold
and ReleaseHold
commands?