The following file gets ! TeX capacity exceeded, sorry [input stack size=5000]. If I remove the call to \tl_gput_right:Nn then it compiles successfully.
\documentclass{article}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{xparse} % loads expl3
%See interface3.pdf
\ExplSyntaxOn
\NewDocumentCommand{\uqual}{mm}
{
\int_compare:nTF { \tl_count:n { #1 } > 1 }
{
Extended \ parm \ #1 \
\bool_gset_true:N \g_tmpa_bool
\tl_gclear:N \g_tmpa_tl
\tl_map_inline:nn{#1}
{
mapping \ ##1 \
\if_bool:N \g_tmpa_bool
{
first \ item \ ##1 \
\bool_gset_false:N \g_tmpa_bool
\tl_gset_eq:NN \g_tmpa_tl ##1
} \else: {
next \ item \ ##1
\tl_gput_right:Nn \g_tmpa_tl {xx ##1}
} \fi:
}
test \ tokenlist=\g_tmpa_tl \
\expandafter
\left ( {\forall}_{ \g_tmpa_tl} \right ) #2
}
{
single \ parm \ #1 \
\expandafter
\left ( {\forall}_{#1} \right ) #2
}
}
\ExplSyntaxOff
\begin{document}
$\uqual{{X}}{P(X.Y)}$
$\uqual{{X}{Y}}{P(X,Y)}$
\end{document}
\
a lot – you probably want to use~
instead. – Sean Allred Sep 15 '16 at 1:16\text
or are those just debug statements? – Sean Allred Sep 15 '16 at 23:14\msg_term:n
) – Sean Allred Sep 15 '16 at 23:15