Often I find myself in the need of expanding some macro, whose contents should be given as an argument to another command. The usual solution is to invoke some \expandafter concoctions to somehow control the expansion, but I wonder if (at least for some common cases) there is an easier way.
As an example, imagine that I want to write something like the following
\somecommand{Some Argument}{\secondarg}
But I want to expand \secondarg before actually attempting to process \somecommand.
For this kind of scenarions, would it be possible to define a command so that
\expandafterallthat{\somecommand{Some Argument}}{\secondarg}
expands to something like
\somecommand{SomeArgument}{Contents of secondarg macro}
etoolboxoretextoolsprovides some macros like this. I think it is the latter. – Martin Scharrer♦ Jul 4 '11 at 14:05