* Bruno Le Floch <[log in to unmask]> [2012-02-06 06:36:23 -0500]: Hi Bruno, : The problem is that you \tl_use:N \l_expr_tl before defining \f:n. If : you look at which line the error occurs, this is the line. To display : a token list to the terminal (or log file), use one of the lines : : \tl_show:N \l_expr_tl : \iow_term:x { \tl_to_str:N \l_expr_tl } : \iow_log:x { \tl_to_str:N \l_expr_tl } : : Those differ in the details, but give you the information without : expanding the token list: the last two lines convert the token list to : a string of characters before printing them to the terminal or the log : file. On the other hand, \tl_use:N is like typing the token list in : your file. It will then be run as normal code, in particular expanding : macros, including \f:n which is not defined yet. : : > 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? : : It does not have to be defined at substitution time, but at use time. : See below. Thanks. I think I solved this problem. An level of expansion had to be prevented. The substitution went fine, but when the regular expression was inserted in the body of a macro definition the resulting \f:n was evaluated:-) Adding a \c{exp_not:N} before the \c{\u{l_recurrence_name_tl}:n}} dif the trick. I'm still working on the other problems. Also I have to properly read your last comments, but this will have to wait until after my 2 p.m. lecture. Thanks again for your help. Regards, Marc