# What would be your minimalistic wish list for new TeX programming primitives? [closed]

I have written a lot of 'weird' TeX over the years and have never encountered a situation where TeX's programming environment was completely inadequate. I have, however, often wished for just a little more help when writing complicated macros. Discovering juggling braces, conditionals and \string, as well as the \romannumeral-1... trick was fun but felt a bit too idiosyncratic. Now (only a month ago if one can believe this! and I have been using TeX for over twenty years!) that I have looked at LaTeX3 code (expl3 to be more precise, I still cannot make myself use LaTeX), I have found a number of the same tricks that I have almost been ashamed to use (I have even picked up a couple of slightly shorter ways of achieving some effects).

So, after this long introduction, what would be your wish list for a TeX extension that addresses original TeX's programming inefficiencies, and why, if possible?

Ideally, this will be a short list (5 items or less). Only the programming environment should be addressed (i.e. nothing involving TeX's handling of, say, fonts, other typographic issues, etc. Frank Mittelbach's paper on the topic treats that area quite well). Note that I enjoy TeX's minimalist philosophy and macro programming in general (although it feels like I have got wings when I switch to writing embedded code in C), so I am looking for an answer more in TeX's spirit rather than 'just use LuaTeX' (I have nothing agains LuaTeX per se it just feels a bit ad hoc; I also feel that making programming too easy is not a great idea). If the answer is 'e-TeX (or some other extension) already does all of this and here is why e-TeX's choices are better', please elaborate.

\xxpandafter{tokens} -- expands the token following the group

\iftoks{token list}{token list} -- compares two token lists (same as \def\listone{...}\def\listtwo{...}\ifx\listone\listtwo ... but expandable)

\unlet token -- expands to a category code, character code token or nothing if the token is not an active character/control sequence let to such a character

\numexpr -- same as e-TeX (only wish it was paired with \endnumexpr instead of \relax)

\batchxmode{...} allows for automatic recovery from errors for the code expanded inside the braces, itself expands to nothing (i.e. same as \batchmode ... \errorstopmode but expands to nothing)

## closed as too broad by Martin Schröder, cfr, Svend Tveskæg, Werner, JesseMar 23 '14 at 1:20

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• I think I don't agree with the closing idea; I like this question, especially that I predict that I could learn something from answers posted by Grand TeX Wizards. – mbork Mar 22 '14 at 23:40
• Also, I'm curious, why the OP feels that "making programming too easy is not a great idea". (I can imagine a sound argument for that, though not necessarily agree with it, but I'd like to hear the OP's opinion.) – mbork Mar 22 '14 at 23:41
• @mbork The reason I think making programming too easy is not a good idea for a highly specialized system such as TeX is such accessibility tends to be abused, in the sense that quick and dirty' solutions eventually prevail. Think of how much software has been written as shell scripts! This is somewhat subjective of course, I am mainly trying to gather information and to learn something (I have written TeX extensions myself before). – alexsh Mar 22 '14 at 23:55
• Maybe the question should be community wiki? It doesn't really fit as a regular question, I don't think, because it isn't really clear what will count as a good answer. (What criteria will the OP use when deciding which answer to accept? It isn't clear.) Also it isn't clear to me how useful it is given that it is focused on commands which do not exist. That's not to say useful stuff won't emerge but it will probably be from disputes about the answers e.g. 'I'd like \xyz...' followed by 'But you can use \abc` for that!' etc. – cfr Mar 23 '14 at 0:05
• @mbork Then there is Alan Perlis' When someone says "I want a programming language in which I need only say what I wish done," give him a lollipop. I would also like the solution to be unique. I know, I know ... – alexsh Mar 23 '14 at 0:31