Metaprogramming Text Processor

Meta-level Predicates

meta-predicate :=  equality-test
		|  existence-test
		|  compound-test

equality-test :=  slot-id '=' target-value
existence-test :=  slot-id
compound-test :=  and-test  |  or-test  |  paren-test

and-test :=  meta-predicate '&' meta-predicate
or-test :=  meta-predicate '|' meta-predicate
paren-test :=  '(' meta-predicate ')'

Predicates are used within conditionals (within MTP selection operations) to choose among alternative target contents. The value of a slot can be tested for equality with a target value. The presence of an optional slot can be tested using a simple reference to the slot identifier. Compound predicates can be formed using 'and' operations, 'or' operations, and parenthesized grouping of compound predicates, with the usual meanings.


Slots, of parameters or tuples, can be marked as optional. If such a slot is omitted from a corresponding value, any reference to that slot in an equality or existence predicate makes that predicate false. The existence predicate evaluates to true for any required slot.