Previous Up

A.6  Short and Canonical Syntax

The following table summarises the correspondence between the short syntax forms (supported by the parser and the term writer) and their corresponding canonical forms. Usually, the programmer does not have to be concerned about the canonical represention because the short syntax is accepted by the parser and reproduced by the term writer (unless canonical writing is explicitly requested).

Known as                Short    Canonical                    Active
------------------------------------------------------------------------
List                    [A|B]    .(A,B)                       always
Curly brackets          {A}      {}(A)                        always
Subscripted variable    X[...]   subscript(X, [...])          default
Subscripted struct      S[...]   subscript(S, [...])          default
Declared structure      f{...}   with(f, [...])               default
Attributed variable     X{...}   'with attributes'(X, [...])  default
Variable functor        X(...)   apply(X, [...])              optional

Here A and B stand for arbitrary terms, X for a variable, S for a compound term in canonical syntax, f for an arbitrary functor, and the ellipsis for a comma-separated sequence of arbitrary terms.


Previous Up