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.

  • 1
    \let\outer\relax should solve the problem ;-) – Phelype Oleinik Jan 14 '21 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 '21 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). – Phelype Oleinik Jan 14 '21 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... – Phelype Oleinik Jan 14 '21 at 19:45
  • @PhelypeOleinik Control-word-tokens/control-symbol-tokens defined in terms of \outer are (regardless error-messages when using them inside \lowercase/\uppercase) not affected by \uppercase/\lowercase but (without wrapping them into \uppercase/\lowercase) can be redefined in terms of \outer: \outer\def\x{y}\outer\def\x{z}\bye . The condition of not being redefinable in terms of \outer is not strictly fulfilled for outer-tokens. ;-) – Ulrich Diez Jan 14 '21 at 19:56
  • @UlrichDiez That's why “still redefines \x”. My remark was clinging on the fact there's an error, so anyone sensible would stop there and the redefinition would not happen ;-) – Phelype Oleinik Jan 14 '21 at 20:00
  • @PhelypeOleinik "\outer tokens can't appear in the argument to anything" Some more nitpicking: \outer-tokens can occur in arguments of macros if they are "hit" by \noexpand right before macro-expansion takes place: \def\foo#1{#1}\outer\def\x{y}\expandafter\foo\expandafter{\noexpand\x}\bye. – Ulrich Diez Jan 14 '21 at 20:01
  • 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. – Phelype Oleinik Jan 14 '21 at 20:09

1 Answers1

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

David Carlisle
  • 757,742