3

This is more an "academical" question:

Is there a token which neither can be redefined to be \outer nor can be affected by \uppercase/\lowercase no matter what \lccodes/\uccodes are current?

Assuming that functionality of the \outer-primitive is available/does not get disabled.

8
  • 1
    \let\outer\relax should solve the problem ;-) Jan 14 at 19:12
  • 1
    @PhelypeOleinik No. ;-) I want some tokens to be \outer in my code. ;-) One token not to be refedinable in terms of \outer and not affectable by \uppercase/\lowercase would be nice, e.g., with macros that insert sentinel-tokens for list-processing. The sentinel-token should not be transformable to s.th. else. The sentinel should not be redefinable in terms of \outer as that would break its usage with (internal) macros where it is inserted automatically as a compoonent of arguments. It is rather an academical/moot question.
    – John Smith
    Jan 14 at 19:18
  • 1
    That was an (admittedly not very good) joke, but the extra explanation would be nice in the question, for context. However I'm afraid the answer to your question is “no, there's none”. \(upp|low)ercase change all character tokens (regardless of catcode, and assuming they have a proper \(u|l)ccode), so you are looking for a non-character token, which are control sequence (or symbol) tokens, which are all redefinable. (Discarding internal frozen TeX tokens, like \endwrite, that cannot be redefined, but can't be used in your code either). Jan 14 at 19:41
  • Well, unless of course you consider the fact that \outer tokens can't appear in the argument to anything (including \(upp|low)ercase), so the answer to your question is “any already \outer token”. This raises an error \outer\def\x{y} \lowercase{\outer\def\x{z}} \show\x, but still redefines \x... Jan 14 at 19:45
  • 2
    @UlrichDiez For some definition of “appear”, yes. When you do that, they are temporarily \let to \relax, so they aren't technically \outer anymore. Jan 14 at 20:09
4

A frozen \relax token more or less meets the description. As it is not a character token it is not affected by lowercase and it can not be redefined at all, any attempt would generate an error, or redefine the standard \relax


\edef\zz{\ifnum0=0\else\fi}\show\zz


%define \zzz delimited by a frozen relax
\expandafter\def\expandafter\zzz\expandafter#\expandafter1\zz
         {\def\arg{#1}\show\arg}




% calling \zzz  shows delimted argument is abc
\edef\tmp{\noexpand\zzz abc\zz}
\tmp


%using a normal \relax does not delimit the argument
\zzz abc \relax


\bye

2
  • @UlrichDiez yes, as I didn't say what the "attempt" should be the outcome is vague, I could re-word to say "an error or redefining a standard relax" May 9 at 13:34
  • @UlrichDiez I added the text anyway, I think error is the most likely outcome. May 9 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.