. "If you look at a single TeX run, it is essentially intended to be a deterministic function from some input (the source file plus other data files such as classes, packages and font information) to some output (classically dvi, these days mainly pdf), without any side effects apart from reading/writing the files." . . .