I've done a few searches, and found possible solutions to my question. However, those that I saw were somehow more complicated than what I think I really need. So please excuse me for asking again. Here's the scenario:
I want to define a math command that gives the long exact sequence of the given parameters. So for example, if I write \longexactsequence{A}{B}{C}{D} then I expect to have something like 0 \longrightarrow A \longrightarrow B \longrightarrow C \longrightarrow D \longrightarrow 0.
Similarly, if I just write \longexactsequence{A}, then I would just get 0 \longrightarrow A \longrightarrow 0.
How can I do this? I'm also pushing this one step further, as I would doubly appreciate a "fix" for breaking the line if the output equation is already too long.
Thanks a lot, and all comments, hints, etc would be greatly appreciated!


\@ifnextchar\bgroup. It may be easier and more robust to simply use a,to separate the entries:\longexactsequence{A,B,C,D}. – Qrrbrbirlbel Jul 30 '13 at 23:33