Validation in the Build Process
Validation occurs at the beginning of the build process, any errors that are found during this validation are added to the error list. If any errors occur, the error list will open automatically at the end of the build.
Validation done during the build process includes:
Namespace Validation
- The only objects in the NamespaceObjects namespace should be object definitions that define namespaces.
- Objects that define a namespace shouldn't have more than one parameter. Most namespaces don't have any parameters. The Data namespace takes one parameters (which must be a namespace) and is used when we need to manipulate terms in expressions that would normally be executable. See Namespace Objects for more details.
- Objects that define a namespace should always have the Namespace type. The Data namespace has type Namespace → Namespace.
- Objects that define a namespace shouldn't have extensions.
Built-in Function Validation
Objects that are built in functions shouldn't have clauses or extensions.
Type Function Validation
For the Subtypes function, we validate the following:
- Each clause must be a subtype expression.
- Both parmeters of the subtype expression have to be explicit types. Types that have parameters (Set[U] for example) can contain variables, but expressions like "TypeA subtype U" are not valid.
- The validator tests for circular subtype relationships and generates errors if any are found.
- "To" objects are not allowed in the subtype expressions. Expression like "TypeA → TypeB subtype TypeC" or "TypeA → TypeB subtype TypeC → TypeD" are not valid.
Command Validation
The command validator does the following:
- Generate warnings if more than one command uses the same keystroke.
- Tests that the type definitions of the functions assigned to the command are valid. See the section Functions Executed by Commands for details.
Object Definition Validation
Check for duplicate object definitions (same name, same type in the same library or in different libraries if there are no clauses). Generate warnings.
- If the expression isn't a valid object definition, then add an error message and ignore the object.
- An error message will be generated for any type definitions that has a TypeList parameter and additional parameters.