I'm trying to change a custom environment from a lot of optional parameters to a ;-separated list (using this answer as a template and writing its main functionality as a latex3 macro).
The macro should put each of the tokens in the list on a separate line, formatted with a monospace font (it's source code). I previously used \lstinline from listings, but it seems to be incompatible with the latex3-variable. Using \texttt instead works.
I'd rather stay with \lstinline than with \texttt, because I need the postbreak feature it provides for marking breaks in long lines.
To reproduce the problem:
\documentclass{minimal}
\usepackage{listings,xparse}
\lstset{basicstyle=\ttfamily,breaklines=true,columns=fullflexible}
\NewDocumentCommand{\code}{m}{\textbf{\texttt{#1}}} % works
% uncomment for error
%\NewDocumentCommand{\code}{m}{\lstinline{#1}} % results in "Improper
% alphabetic constant."
\ExplSyntaxOn
\NewDocumentCommand{\methods}{m}{\methods_main:n {#1}}
\seq_new:N \l_methods_body_seq
\cs_new:Npn \methods_main:n #1
{
\noindent
\seq_set_split:Nnn \l_methods_body_seq {;} { #1 }
\seq_pop_right:NN \l_methods_body_seq \l_tmpa_tl
\seq_map_inline:Nn \l_methods_body_seq { \code{##1} \\ }
\code{\tl_use:N \l_tmpa_tl} %<---- error occurs in this line
}
\ExplSyntaxOff
\begin{document}
\methods{monoSpacedLine1();int methodSignature();const int ANSWER 42}
\end{document}
The error occurs with every argument to the \methods macro I tried.
I also already tried using \tl_to_str:N instead of \tl_use:N, or putting extra braces around it.
Is it possible to expand the variable in a way that \lstinline accepts it?
