red_admiral 5 days ago

> Why introduce two layers of macro indirection

TeX already has more than enough layers of macro indirection :/

Try debugging an \makeatletter\expandafter and you're going to have a bad day. I think the macro system is even Turing-complete in some sense, certainly the number of times you potentially need to run TeX to guarantee a complete output reduces to the halting problem.

1
JadeNB 5 days ago

> > Why introduce two layers of macro indirection

> TeX already has more than enough layers of macro indirection :/

Sure, I should have said "another layer of macro indirection" instead of just two!

> Try debugging an \makeatletter\expandafter and you're going to have a bad day. I think the macro system is even Turing-complete in some sense, certainly the number of times you potentially need to run TeX to guarantee a complete output reduces to the halting problem.

So is the indirect (har!) answer that, for you, which I know isn't the same as the person I was originally responding to, introducing the new macro layer allows you to replace some of the TeX-level indirection by a more concretely understandable macro expander?

(By the way, you are right that TeX's macro system is Turing-complete, not just incidentally but intentionally; Knuth didn't plan to make it so, but did so by request from Steele.)