The test \tl_if_empty:NTF \l_bob_otherlist_tl {}{}
sees just the empty token list \l_bob_otherlist_tl
, but \tl_if_empty:nTF {\l_bob_otherlist_tl} {}{}
sees one token in the 'list' delimited by {...}
.
See the difference for example with the \tl_count:n
and \tl_count:N
macros:
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\tl_new:N \l_bob_otherlist_tl
First: \tl_if_empty:nTF \l_bob_otherlist_tl {T} {F}
\par
Second: \tl_if_empty:NTF \l_bob_otherlist_tl {T} {F}
\par
Third: \tl_if_empty:nTF {\l_bob_otherlist_tl} {T} {F}
\par
\par
Counting~with~n: \tl_count:n {\l_bob_otherlist_tl}
\par
Counting~with~N: \tl_count:N \l_bob_otherlist_tl
\tl_set:Nn \l_bob_otherlist_tl {Foo}
\par
After~setting:\par
First: \tl_if_empty:nTF \l_bob_otherlist_tl {T} {F}
\par
Second: \tl_if_empty:NTF \l_bob_otherlist_tl {T} {F}
\par
Third: \tl_if_empty:nTF {\l_bob_otherlist_tl} {T} {F}
\par
Counting~with~n: \tl_count:n {\l_bob_otherlist_tl}
\par
Counting~with~N: \tl_count:N \l_bob_otherlist_tl
\ExplSyntaxOff
\end{document}
The \tl_clear_new:N
isn't necessary since \tl_new:N
already provides an empty, clean list.
\tl_if_empty:NTF \otherlist
would give T, but ìn\tl_if_empty:nTF {\otherlist}
the "n" contains\otherlist
.\tl_clear_new:N \otherlist
isn't necessary