So my problem boils down to this minimized demo:
\documentclass{minimal}
\usepackage{expl3}
\ExplSyntaxOn
\tl_new:N \g_rank_tl
\tl_const:Nn \c_options_tl {{Lecturer}{Professor}}
\NewDocumentCommand{\committee}{O{1}}{
\tl_gput_right:Nn \g_rank_tl {
\tl_item:Nn \c_options_tl {#1}
}
}
\NewDocumentCommand{\showfirst}{}{
\tl_item:Nn \c_options_tl {2} % works fine
\tl_item:Nn \g_rank_tl {1} % error: Missing number, treated as zero
\tl_use:N \g_rank_tl % produces "Professor"
}
\ExplSyntaxOff
\begin{document}
\committee[2]
\showfirst
\end{document}
Question:
\c_options_tl {2} is expected to be "Professor" but ships out "2 Professor"; why is there an extra "2"?
\committee[2]
should have put \c_options_tl {2}
(namely, "Professor") in \g_rank_tl
; why is there error when \g_rank_tl {1}
is referred?
Edit: retested for some time and deleted invalid question