joulev
MWE:
```
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\tl_set:Nx \l_tmpa_tl
{
\exp_last_unbraced:Nf \use_i:nnn \cs_split_function:N \one_two_three_four
}
\tl_log:N \l_tmpa_tl
\seq_set_split:NnV \l_tmpa_seq {_} \l_tmpa_tl
\seq_log:N \l_tmpa_seq
\ExplSyntaxOff
\end{document}
```
Log file:
```none
> \l_tmpa_tl=one_two_three_four.
The sequence \l_tmpa_seq contains the items (without outer braces):
> {one_two_three_four}.
```
The sequence is not split. It should contains four items `{one}{two}{three}{four}`, but it doesn't.
At first I think this is due to a surrounding pair of braces, but it is apparently not the case (as you can see in the output of `\tl_log:N`).
Interestingly, if the delimiter is set to nothing, `\seq_set_split` works well.
```none
\seq_set_split:NnV \l_tmpa_seq {} \l_tmpa_tl
> \l_tmpa_tl=one_two_three_four.
The sequence \l_tmpa_seq contains the items (without outer braces):
> {o}
> {n}
> {e}
> {_}
> {t}
> {w}
> {o}
> {_}
> {t}
> {h}
> {r}
> {e}
> {e}
> {_}
> {f}
> {o}
> {u}
> {r}.
```
Obviously, if the token list is input directly as `one_two_three_four`, `\seq_set_split` has no problem with the delimiter.
```none
\tl_set:Nx \l_tmpa_tl
{
one_two_three_four
}
> \l_tmpa_tl=one_two_three_four.
The sequence \l_tmpa_seq contains the items (without outer braces):
> {one}
> {two}
> {three}
> {four}.
```
Top Answer
Phelype Oleinik
That's because internally `\cs_split_function:N` will hit your control sequence with `\string`, so all tokens (except spaces) will be catcode 12, but the `_` in `expl3` code is catcode 11 (and outside it's normally catcode 7), so `\seq_set_split:Nnn` won't find the “the letter \_” token. You need to turn `_` into a “string”, by using `\token_to_str:N _` or `\tl_to_str:n { _ }`.
Also note that `\exp_last_unbraced:Nf` means “`f`-expand the argument, and leave it unbraced”, rather than “the arg is unbraced”, so you _need_ braces around `\cs_split_function:N \one_two_three_four` (otherwise it just works by accident ;-)
```latex
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\tl_set:Nx \l_tmpa_tl
{
\exp_last_unbraced:Nf \use_i:nnn
{ \cs_split_function:N \one_two_three_four }
}
\tl_log:N \l_tmpa_tl
\cs_generate_variant:Nn \seq_set_split:Nnn { NxV }
\seq_set_split:NxV \l_tmpa_seq { \token_to_str:N _ } \l_tmpa_tl
\seq_show:N \l_tmpa_seq
\ExplSyntaxOff
\end{document}
```
The log will show:
```none
The sequence \l_tmpa_seq contains the items (without outer braces):
> {one}
> {two}
> {three}
> {four}
```