Skip to content

Instantly share code, notes, and snippets.

@wtsnjp
Created December 10, 2018 05:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtsnjp/373ac5be6440d16600466223c4152a67 to your computer and use it in GitHub Desktop.
Save wtsnjp/373ac5be6440d16600466223c4152a67 to your computer and use it in GitHub Desktop.
% plain TeX
\catcode`@=11
\def\x@cmd(#1){\edef\x@tmp{#1}\ifx\x@tmp\empty
o\expandafter\x@cmd\else\x@fin #1\fi}\def\x@fin'#1'{#1}
\catcode`g=13\chardef\x@s=`g\defg{\char\x@s\x@cmd}
\catcode`@=12
% tests
\noindent
g('al')\break
g()('al')\break
g()()('al')\break
g()()()('al')\break
g()()()()('al')\bye
@wtsnjp
Copy link
Author

wtsnjp commented Dec 10, 2018

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