An interactive session operates a loop, called the “main loop” in this way:
As part of this loop, various global objects in this section are consulted.
There are a variety of “hooks” that allow you to insert functions to be applied to the expressions at various stages in the main loop.
If you assign a function to the global variable $PreRead
it will be applied with the input that is read in the first step listed above.
Similarly, if you assign a function to global variable $Pre
, it will be applied with the input before processing the input, the second step listed above.