Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
2012/10/13 の解答
\catcode`\@=11
\def\letargswapped#1#2{%
\edef\def@macroB{\def\noexpand#1####1####2{\expandafter\unexpanded\expandafter{#2{##2}{##1}}}}%
\def@macroB}
\catcode`\@=12
\def\Frac#1#2{{#1\over#2}}
\letargswapped\RFrac\Frac
$$\RFrac{13}{42}$$ %==>分数「13分の42」が出力される
\edef\hogeA#1#2{#1\string~#2\noexpand~}
\letargswapped\hogeB\hogeA
\expandafter\def\expandafter\expA\expandafter{\hogeA^?}
\expandafter\def\expandafter\expB\expandafter{\hogeB?^}
% \expA も \expB も ^[7]~[12]?[12]~[13] となるはず
\ifx\expA\expB\else\errmessage{Oops}\fi %==> エラーなし
\bye
@kmaed

This comment has been minimized.

Show comment Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment