You can do it, but it's better to tell explicitly what delimiter you're going to using for the particular list.
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand\foo{O{,}mO{\textsf}}
{
\seq_set_split:Nnn \l_lotomat_input_seq { #1 } { #2 }
\seq_map_function:NN \l_lotomat_input_seq #3
}
\seq_new:N \l_lotomat_input_seq
\ExplSyntaxOff
\begin{document}
Test \foo{a,b,c} \foo[;]{a;b;c} \foo[:]{a:b:c}[\textbf]
\end{document}
We have to use lower level functions, in order to be able to change the delimiter. I also added the possibility of giving a different one argument function as trailing optional argument.

Here is a different implementation where the delimiter can be either a comma or a semicolon (you can add other substitutions):
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand\foo{mO{\textsf}}
{
\tl_set:Nn \l_lotomat_input_tl { #1 }
\tl_replace_all:Nnn \l_lotomat_input_tl { ; } { , }
\seq_set_split:NnV \l_lotomat_input_seq { , } \l_lotomat_input_tl
\seq_map_function:NN \l_lotomat_input_seq #2
}
\tl_new:N \l_lotomat_input_tl
\seq_new:N \l_lotomat_input_seq
\ExplSyntaxOff
\begin{document}
Test \foo{a,b,c} \foo{a;b;c} \foo{a,b;c}[\textbf]
\end{document}
The output is the same as before.
\foo{a,b,c}
and\foo[;]{a;b;c}
. In other words, you specify an optional argument that could be used as the\SplitList
parameter.\Splitlist
to blanket split on both,
and;
, correct?\foo{a,b;c}
? Should it be equivalent to\foo{a,b,c}
and\foo{a;b;c}
or behave differently?