I would like to learn to manipulate comma separated lists in Latex. To give a concreet but artificial example, I would like to have this command:
expand to this:
How can I achieve it?
I think you should ask what you want in full generality. For your concrete example,
should work, although I didn't test it.