How to reliably obtain a control sequence token which is undefined in the current scope?
E.g., is there a sequence of tokens ⟨stuff⟩ with which you can do
- TeX won't deliver any error-message while producing the control sequence token from the
- the resulting control sequence token behind
\dosomethingin any case is undefined after processing
I could use this for reliably letting another control sequence token equal to something that is undefined.
By now I do s.th. like
\let\token=\UndeFineD and hope for no piece of third-party-code defining
\UndeFineD before the
\let-assignment is performed.
Another approach could be a loop for constructing names of control sequence tokens until one is found where a test like
But I wonder if there is something more clever.
Perhaps an edge case of a
\csname..\endcsname-expression - something of similar "edgeiness" to the scenario of using "frozen-
\relax" in situations where you need a token which definitely is not an explicit character-token and which definitely never is defined in terms of
Please notice that the focus of the question is not on methods for testing whether a control sequence token is defined/undefined.
I ask for the best way of obtaining a control sequence token that is undefined in the current scope.
In this context, a test for "definedness/undefinedness" would only be a means to an end, e.g., if one chooses the path of creating tokens until one is created that is not defined.
"Academic question": is there an easily implementable method in TeX to enumerate all possible control sequence names?