Is there a way to simultaneously declare and initialize an expl3
integer variable?
Consider the following LaTeX code, which simultaneously declares and initializes a floating point variable.
\documentclass{article}
\begin{document}
\ExplSyntaxOn
\fp_gset:Nn\myvar{1}
\fp_use:N\myvar
\ExplSyntaxOff
\end{document}
When this code is compiled with Overleaf's 2022 LuaLaTeX engine, the compilation completes successfully and prints out 1
.
However, if now the two occurrences of the string "fp" are replaced by "int", and the code is recompiled, the following error message results:
<argument> \myvar
l.4 \int_gset:Nn\myvar{1}
The control sequence at the end of the top line
of your error message was never \def'ed.