The answer to TeX.SX submission Labelling confusion in expl3: (public, private) Vs (global, local) dated May 6, 2016 was accompanied by the code below.
Why does loading expl3 with [check-declarations] produce
!LaTeX error:"kernel/non-declared-variable"
!!The variable \csname\endcsname has not been declared on line …
with reference to the line \tl_gset:cn \c_aloui_constant_tl {Do~not~change~me!}?
\documentclass{article}
%\usepackage{expl3}
\usepackage[check-declarations]{expl3}
\begin{document}
\ExplSyntaxOn
\tl_new:N \g_aloui_global_tl
\tl_new:N \l_aloui_local_tl
\tl_new:N \c_aloui_constant_tl
\tl_gset:cn \c_aloui_constant_tl { Do~not~change~me! }
Constant:~\tl_use:c \c_aloui_constant_tl
\tl_set:Nn \l_aloui_local_tl { Initial~value~for~local~token~list~variable. }
\tl_gset:Nn \g_aloui_global_tl { Initial~value~for~global~token~list~variable. }
\par
Local:~\l_aloui_local_tl
\par
Global:~\g_aloui_global_tl
\par
\group_begin:
Start~group.
\tl_set:Nn \l_aloui_local_tl { Within~group~value~for~local~token~list~variable. }
\tl_gset:Nn \g_aloui_global_tl { Global~change~of~value~for~global~token~list~variable. }
\par
\hfill
\begin{minipage}{.8\textwidth}
Local:~\l_aloui_local_tl
\par
Global:~\g_aloui_global_tl
\par
\end{minipage}
\par
End~group.
\par
\group_end:
\par
Local:~\l_aloui_local_tl
\par
Global:~\g_aloui_global_tl
\ExplSyntaxOff
\end{document}
\tl_const:Nnand used with\tl_use:N \c_aloui_constant_tl. The:cin function names does not mean constant which makes me think both\tl_gset:cnand\tl_use:caren't quite correct here. – moewe Sep 20 '18 at 10:45cargument type when it isn't really necessary, which happens when the function or variable's name depends on some parameter. Not here. – egreg Sep 20 '18 at 11:19