Interpretation process |
Interpretation of documents proceeds in several steps:
We previously noted that a tree label can either be the name of a typesetter primitive or the name of markup tag. Typesetter primitives are the fundamental building blocks of the typesetting languages. Markup tags can be though of as the functions and procedures of the typesetting language. Tree leaves are character strings.
Primitives and markup tags are collectively referred to as
typesetter operators, or operators
for short. Trees are expressions, tree labels are operators names and
subtrees are operands. All expressions have a value and all values are
trees. A trivial tree is only made of a string. In this respect, the
typesetting language is similar to
However, an important difference with
Most operators are only meaningful either for evaluation or typesetting: computational operators only have a meaning for evaluation and are substituted before typesetting, physical operators only have a meaning for typesetting and are self-evaluating. Operands are evaluated in applicative order. The typesetting language does not use normal order lazy evaluation, but it provides mechanisms for partial and delayed evaluation.
Operators may not display all their subtrees. Most computational operators and many physical operators consume at least one of their operands. Trees which are not associated to typeset boxes are invisible and inaccessible. Conversely, boxes which are not associated to subtrees of the document tree are uneditable. Trees which are produced during evaluation are called synthetic trees and are uneditable. Understanding which operators produce editable values and how they affect the accessibility of their operands is essential to designing good typesetter macros.
What you should remember:
Now that you understand the basic rules of the language, we will describe its atomic data types and data storage mechanisms. Compound values are described in the chapter about typesetter primitives, along with the primitives used to create and operate on them.