commands with a non-letter in token.set_macro
Commands that should be use in token.set_macro must already exist. But while it is easy to predefine a command like \blub it seems not to be possible to do it with commands consisting of a \ with a non-letter. E.g. I put this in a luatest.lua token.set_macro("foo","\\bar\\blub\\!") and then compile \def\!{hallo} \def\blub{hallo} \directlua{require"luatest"} \show\foo \bye I get:
\foo=macro: ->\bar \blub BAD!. l.254 \show\foo
so the \blub works, but not the \!. How can one repair this? -- Ulrike Fischer https://www.troubleshooting-tex.de/
On Tue, Dec 10, 2019 at 10:36 PM Ulrike Fischer
Commands that should be use in token.set_macro must already exist. But while it is easy to predefine a command like \blub it seems not to be possible to do it with commands consisting of a \ with a non-letter.
perhaps --[==[ luatest.lua ]==] token.set_macro("foo",[==[\blub\csname !\endcsname]==]) %%test.tex \tracingall \def\!{[hallo!]} \def\blub{[hallo]} \directlua{require"luatest"} \show\foo \foo \bye (untested) -- luigi
participants (2)
-
luigi scarso
-
Ulrike Fischer