Trying to adapt the 1st code of this answer in order to format (say in bold) items of a LaTeX3 comma list, I stumbled upon an unexpected error: the following MWE works like a charm:
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\bolditems}{ m }
{
\bold_items:n {#1}
}
\cs_new_protected:Npn \bold_items:n #1
{
% does what the name suggests, set a sequence from the clist
\seq_set_from_clist:Nn \l_tmpa_seq {#1}
% applies final arg to each element of second seq and stores result in first seq
\seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq {
##1
% \textbf{##1}
}
% \seq_use puts the items from the seq back in the input with "+" as a separator
\seq_use:Nnnn \l_tmpb_seq {,~}{,~}{,~}
}
\ExplSyntaxOff
\begin{document}
\bolditems{}
\bolditems{foo}
\bolditems{foo,bar}
\bolditems{foo,bar,baz}
\end{document}
but, if ##1 is replaced by \textbf{##1}, fails with error:
! Argument of \reserved@a has an extra }.
<inserted text>
\par
l.26 \bolditems{foo}
?
Why?

\exp_not:N \textbf { ##1 }; as explained in the interface manual,\seq_set_map:NNntries full expansion of the items it finds. Better yet, perhaps,\exp_not:n { \textbf { ##1 } }– egreg Oct 28 '15 at 18:39\noexpand\textbf{##1}(or better the equivalent to \noexpand ;-)) – Ulrike Fischer Oct 28 '15 at 18:39