Say someone has defined
\documentclass{minimal}
\begin{document}
\def\fooA#1@{}
\makeatletter
\def\fooB#1@{}
\end{document}
It is easy to test and see that the two are different: \ifx\fooA\fooB...\else...\fi.
But if we are given one of \fooA and \fooB and we have not seen the definition before, can we tell what the catcode of the @ delimiting the parameter is?
Disclaimer: I am interested in the answer out of sheer curiosity.
EDIT: basically, is there a version of \meaning which keeps catcodes? or is there a way to show the catcodes of tokens in the parameter text? --- The answer, below, is "no".
etoolboxdoes, where it checks if the catcodes in a definition are at least the same as those which are current. – Joseph Wright Jan 28 '11 at 22:38\etb@ifscanabledoes the following: it reads the meaning of its argument; splits it in the different pieces (prefixes, parameter text, replacement text) ; and builds a definition out of this. Then it compares the result of the definition with the original command using\ifx. If it is the same, then etoolbox knows that it can recreate the macro, and hence patch it. – Bruno Le Floch Jan 28 '11 at 23:04