%%% Bernd Raichle: \input file inside a macro definition.
If you have a file and want to read its contents in a macro definition, \TeX{}
does not allow to simply use

\beginverbatim
\edef\foo{\input file }
\endverbatim

because at the end of a file \TeX{} checks if you are inside an incomplete 
\type{\if}
statement or \type{\def} macro definition and outputs the error message

\beginverbatim
! File ended while scanning text/definition of ...
\endverbatim

Nonetheless there is a non-trivial way to avoid this error message:

\beginverbatim
\immediate\openout15=bt-pp-r4.tex
\immediate\write15{Another TeX}
\immediate\write15{Pearl\string\noexpand}
\immediate\closeout15

\edef\foo{Yet \input bt-pp-r4.tex !}
\message{\meaning\foo}
\endverbatim

The primitive \type{\noexpand} does all the magic and you will get

\beginverbatim
macro:->Yet Another TeX Pearl!
\endverbatim

without any error message.

{\bf Question:} Why has \type{\noexpand} this effect?

If you are using \eTeX, you can set its new special token list \type{\everyeof} to
\type{\noexpand} to achieve this effect without changing the file.
