%
% These want to go first:
%
\let\ea=\expandafter
\let\cs=\csname
\let\ecs=\endcsname
\let\nox=\noexpand
\def\iw{\immediate\write16}
%
\catcode`\Q=0
Qcatcode`Q\=12
QletQbs=\
Qcatcode`Q\=0
\catcode`\Q=12
%
\def\spc{ }
%
\def\makecsaddn#1{%
\edef\addn{\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\ea\nox
\ea\ea\ea\ea\ea\ea\ea\nox\ea\ea\ea\nox\ea\nox\cs #1\ecs}}
%
\newcount\n\n=0
%
\def\appendcs#1#2{%  appends #2 to the list in #1
\makecsaddn{#2}
\advance\n by 1
\ea\let\cs\the\n\ecs=\list
\edef #1{\ea\ea\ea\nox\ea\cs\the\n\ecs\addn}}
%
\def\append#1#2{%  appends #2 to the list in #1
\advance\n by 1
\ea\let\cs\the\n\ecs=\list
\edef #1{\ea\ea\ea\nox\ea\cs\the\n\ecs#2}}
%
\def\list{}
%
%  Test the sucker....
%
\def\a{\b}
\def\b{\c}
\def\c{\d}
\def\d{foo}
%
\def\blst{
\catcode`\m=12
\catcode`\a=12
\catcode`\c=12
\catcode`\r=12
\catcode`\o=12}
%
{\blst\gdef\gbl macro:->{}}
%
\def\expandonce#1{\ea\ea\ea\parse\ea\gbl\meaning #1 ^^Q^^Q^^A\list}
%
\def\parse#1#2^^A{\if #1\bs\backstab #2 ^^B\else
\if #1^^Q\iw{help me, charlie brown!}\else
\append{\list}{#1}\parse #2^^A\fi\fi}
%
\def\backstab #1 #2^^B{\appendcs{\list}{#1}\parse #2^^A}
%
%backstab was: {\xdef\word{}\futurelet\nexttok\check #1}
%\def\check{\begingroup\if\nexttok^^B % then it's empty
%\else\ifcat\nexttok\spc%                 then it's the end
%\aftergroup\csdone
%\else\aftergroup\addtoword\fi\endgroup}
%
%\def\addtoword#1{\xdef\word{\word #1}\futurelet\nexttok\check}
%
%\def\csdone{\appendcs{\list}{\word}\dumpcb}
%
%\def\dumpcb #1^^B{#1}
%
\tracingmacros=2 \tracingcommands=2\nonstopmode
\immediate\write16{First try: }\expandonce\a\message{\list}
%\immediate\write16{Sec'd try: }\message{\expandafter\expandonce\expandonce\a}
\errorstopmode
