# \let a control sequence to a redefined primitive

pdfTeX version 1.40.0 introduced the primitive \pdfprimitive which the manual describes as follows.

This command executes the primitive meaning of the following control sequence, if it has been redeﬁned or made undeﬁned. If the following control sequence is undeﬁned and never was a primitive, nothing happens and no error is raised. If the control sequence was initially expandable, \pdfprimitive expands either. Otherwise \pdfprimitive doesn’t expand.

(I think “either” should be “too.”)

Is there a way to \let a control sequence to the primitive version? Something like

\let\input\relax
\pdfletprimitive\input\input


The idea being that \input could be restored to its original meaning (at least locally). Obviously

\let\input\pdfprimitive\input


is not going to work just as

\expandafter\let\expandafter\input\pdfprimitive\input


is not going to work.

-

No, I'm afraid not. When you \let or \def the original definition of primitive to something, the original meaning is no longer available as an accessible token. \pdfprimitive can be used to access the internal definition of the primitive, but that is not the same as 'regenerating' the accessible token. The nearest you can get is

\def\<primitive>{\pdfprimitive\<primitive>}


for expandable primitives or

\protected\def\<primitive>{\pdfprimitive\<primitive>}


for non-expandable ones.

-
And it would seem that that doesn't work for \endcsname. My use case was fairly ridiculous anyway, so it's not like this is a show stopper. =) Thanks. –  TH. Mar 18 '11 at 11:01