<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">David Carlisle wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEW6iOhojp=gn9T7nBX=qm=eLqTynVqa27KGrPkrs1SZFZd8vg@mail.gmail.com">
<pre wrap="">actually before you do, let me check some of the tex expansion side,
was just trying now and \protected not working quite as I thought,
but it's late, someone else free to try
I'll report back later
but
\catcode`A=13
\protected\defA{x}
\input xAb
\bye
looks like it is expanding A anyway so perhaps I'm just wrong about
\protected, it happens:(
! I can't find file `xxb'.</pre>
</blockquote>
The documentation says :<br>
<blockquote type="cite">
<dl>
<dt><tt>\protected</tt> </dt>
<dd>is a prefix, analogous to <tt>\long</tt>, <tt>\outer</tt>,
and <tt>\global</tt>;
it associates with the macro being defined an attribute which
inhibits
expansion of the macro in expansion-only contexts (for
example, within
the parameter text of a <tt>\write</tt> or <tt>\edef</tt>);
if, however,
the parser or command processor (TeX's `oesophagus' and
`stomach', in
Knuth's alimentary paradigm) is currently demanding a <i>command</i>,
then
the <tt>\protected</tt> macro will expand in the normal way.
This behaviour
is identical to that displayed by the explicit expansion of a
token-list
register through the use of <tt>\the</tt>; the same model is
used elsewhere
in e-TeX to achieve a consistent paradigm for <i>partial
expansion</i>.
</dd>
</dl>
</blockquote>
so the question is "is \input an expansion-only context or does its
use cause the parser or command processor to expect a command ? The
TeXbook says "the expansion is null; but TeX prepares to read from
the specified file ...". I interpret the latter as indicating that
expansion will be inhibited when \input expands to null, but not
inhibited when TeX prepares to read from the specified file.<br>
<br>
** Phil.<br>
</body>
</html>