% \iffalse
% <*chit>
% --------------------------------------------------------------------
% \fi
% \subsubsection{Stacking of chits}
%
% Stacking of chits.  The key \spec{chit/stack direction} sets the
% default direction to make the stack in.
% 
%    \begin{macrocode}
% offset, location, direction, list
\tikzset{%
  chit/stack direction/.store in=\chit@stack@dir,
  chit/stack direction/.initial={(.3,.3)},
}
%    \end{macrocode}
%
% Now the code 
%
%    \begin{macrocode}
\def\chit@stack@dir{(.3,.3)}
\def\stackchits(#1){%
  \@ifnextchar({\st@ckchits{#1}}{\st@ckchits{#1}(.3,.3)}%)
}
\def\st@ckchits#1(#2)#3{%
  \chit@dbg{2}{Stacking chits `#1', `#2', `#3'}%
  \edef\xy{#1}%
  \chit@dbg{4}{Stack start at \xy}%
  \foreach[count=\i from 0] \c/\o in {#3} {%
    \ifx\c\empty\else%
      \edef\ccc{\c}%
      \chit@dbg{2}{Adding \meaning\ccc\space to stack at (\xy)' `\o'}%
      \expandafter\ccc(\xy)%
      %%
      \ifx\c\o\else%
        %\chit@dbg{0}{Option: \o}
        \edef\ccc{\o}%
        \expandafter\ccc(\xy)%
      \fi
      \expandafter\ccc(\xy)%
      \tikzmath{%
        coordinate \cc;%
        \cc = (\xy) + (#2);}
      \xdef\xy{\cc}%
    \fi%
  }%
  \@ifnextchar;{\@gobble}{}%  
}
%    \end{macrocode}
%
% \iffalse
% </chit>
% --------------------------------------------------------------------
% \fi
