Question: Why is \l_keys_choice_tl in l3keys a tl instead of a str variable?
My understanding is that key names are stored as strings using \tl_to_str:n. For choice keys, each choice is implemented as just another key. e.g. \keys_define:nn { module } { key .choices:nn = { one , two } { <code> } } defines the keys module/key/one and module/key/two.
For example, the following code:
\documentclass{article}
\ExplSyntaxOn
\debug_on:n { all }
\str_new:N \l_module_name_str
\keys_define:nn { module }
{
key .choices:nn = { one , two }
{ \str_set:Nn \l_module_name_str {#1} }
}
\ExplSyntaxOff
\begin{document}
text
\end{document}
generates the following in the .log file:
Defining key module/key on line 11
Defining key module/key/unknown on line 11
Defining key module/key/one on line 11
Defining key module/key/two on line 11
Since the selected choice of a choice key is treated as a string, then shouldn't the variable that stores the selected choice also be a string?