Domain specific primitives are particular identifiers that allow Gobstones WordsDef to be extended with a particular domain providing the "concrete" elements needed for didactic purposes, such as the Board and Stones, the Standard Gobstones Domain. This interface defines the minimum structure to organize domain specific primitives that can be provided to WordsDef according to Gobstones language categories. The behavior of those primitives has to be provided by separately to fully customize the domain specific part of the language.

The field LanguageDomain provides the name of the extension in order for programs to be able to identify when they are tailored for a particular domain using a language pragma.

The primitive abstract names are organized according to Gobstones language categories: types and data constructors by type, and operations (procedures and functions). Data constructors must be organized according to the types given in the types field.

interface DomainSpecificPrimitives {
    DataConstructorsByType: {
        [index: string]: WordsFlatDef;
    };
    LanguageDomain: string;
    Operations: {
        Functions: WordsFlatDef;
        Operators: FixityLevel[];
        Procedures: WordsFlatDef;
    };
    Types: WordsFlatDef;
}

Properties

DataConstructorsByType: {
    [index: string]: WordsFlatDef;
}

Type declaration

LanguageDomain: string
Operations: {
    Functions: WordsFlatDef;
    Operators: FixityLevel[];
    Procedures: WordsFlatDef;
}

Type declaration