Created
October 13, 2012 17:39
-
-
Save kmaed/3885495 to your computer and use it in GitHub Desktop.
2012/10/13 の解答
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://d.hatena.ne.jp/zrbabbler/20121013/1350110975