* dongen <[log in to unmask]> [2012-02-06 10:51:03 +0000]:
Hi again,
I think I found the cause of the problem. The following should
explain it.
\documentclass{article}
% too many includes here.
\usepackage{xparse}
\usepackage{expl3}
\usepackage{l3regex}
\usepackage{l3int}
\begin{document}
\ExplSyntaxOn
\tl_new:N \l_name_tl
\tl_set:Nn \l_name_tl {f}
\tl_new:N \l_expr_tl
\tl_set:Nn \l_expr_tl {f{i}}
% uncomment and (only) and this works.
% \cs_new_nopar:cpx { \l_name_tl :n } #1{}
\noindent before:(\tl_use:N \l_expr_tl)\par
and:(\tl_use:N \l_name_tl)\par
\regex_replace_all:nnN {\b\u{l_name_tl}\b}
{\c{\u{l_name_tl}:n}}
\l_expr_tl
after(\tl_use:N \l_expr_tl)
% uncomment and (only) and this won't work.
% \cs_new_nopar:cpx { \l_name_tl :n } #1{}
\end{document}
In the equivalent of my recurrence equations implementation, the
macro \f:n is defined _after_ the substitution. The error complains
about \f:n not being defined. Defining \f:n _before_ the substitution
works fine.
In my recurrence equation implementation, defining \f:n _after_ the
substitution is possible, but it requires a bit more work. Does \f:n
have to be known at substitution time?
Regards,
Marc