\def\permutation#1{\xpermutation{}{\@gobble}#1\relax}
\def\xpermutation#1#2#3{%
\ifx\relax#3%
\begin{array}{@(#1@)}#2\end{array}%
\expandafter\@gobbletwo
\else
\ifx;#3%
\expandafter\expandafter\expandafter\@secondoftwo
\else
\expandafter\expandafter\expandafter\@firstoftwo
\fi\fi
{\xpermutation{#1c}{#2}}{\xpermutation{#1@{}c@{}}{#2&)(}}%
}