As explained in interface3
\int_to_roman:n {<integer expression>}
Places the value of the
<integer expression>
in the input stream as Roman numerals, either lower case (\int_to_roman:n
) or upper case\int_to_Roman:n
). The Roman numerals are letters with category code 11 (letter).
But, how can I put function value into a some variable, say \l_here_str
not in stream (If I correctly understand stream mean "output to LaTeX
document")?
Maybe the more general question, that refer to the behavior of conventional programming languages, where the functions values can be assigned to the variables: how does it implemented in expl3
?
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\cs_generate_variant:Nn \int_from_roman:n {V}
\cs_generate_variant:Nn \int_to_roman:n {V}
\NewDocumentCommand{\CharCount}{ m }
{ \tl_set:Nn \l_roman_tl {#1}
\int_to_roman:V \l_roman_tl % How to assign mmciv to some variable, say \l_here_str
}
\ExplSyntaxOff
\begin{document}
\noindent\CharCount{2104}
\end{document}
\tl_set:Nx \l_sk_roman_tl { \int_to_roman:n { #1 } }
? (With a previous declaration outside of the function\tl_new:N \l_sk_roman_tl
, don't forget that.)