Consider the following TeX:
\tt
~~~[def]: \meaning\def \par
~~~[let]: \meaning\let \par
[define]: \meaning\define \par
~[macro]: \meaning\macro
\def\macro#1{some #1 transformation}
\let\define\def
\define\hi{hello,}
\let\let\define
\let\hello{world!}
\vskip 2ex
\centerline{
{\hi}
{\hello}
{\macro{argument-based}}
}
\vskip 2ex
~~~[def]: \meaning\def \par
~~~[let]: \meaning\let \par
[define]: \meaning\define \par
~~~~[hi]: \meaning\hi \par
~[hello]: \meaning\hello \par
~[macro]: \meaning\macro
\bye
which produces the output
[def]: \def
[let]: \let
[define]: undefined
[macro]: undefined
hello, world! some argument-based transformation
[def]: \def
[let]: \def
[define]: \def
[hi]: macro:->hello,
[hello]: macro:->world!
[macro]: macro:#1->some #1 transformation
I had thought that \let only copied that macro definition of a control sequence;
is something more fundamental happening here?
In fact, I would not expect \let to be able to
redirect the control sequence for primitive functions to others at all.
Even if \let is simply creating a new reference to a definition,
as this related answer implies,
primitives should not have 'definitions' as I understand them in the context of TeX.
Do the primitives have such 'definitions' that are simply inexpressible in TeX,
but still able to be referenced?
Consider also the extended scenario:
\def\def{bad}
\def \par
[def]: \meaning\def \par
[let]: \meaning\let
would produce
bad
macro:->what?
\def
If \let is doing what it says it's doing, how is \meaning getting a value of \def at all?
\letto\defand now\letis (not expands to) the primitive\def. – Qrrbrbirlbel Nov 07 '13 at 20:08\letonto a primitive, actually. See my edit. – Sean Allred Nov 07 '13 at 20:21\leta command to anything, consider\let\bgroup{which defines bgroup to be an (implicit) catcode 1 brace. – David Carlisle Nov 07 '13 at 21:09\iftrueand\iffalsewhich are let to\if<something>every time\<something>trueand\<something>falseare used. – Qrrbrbirlbel Nov 07 '13 at 21:24\ifsomethingis let to\iftrueor\iffalse– David Carlisle Nov 07 '13 at 21:39