Programming in XPCE/Prolog: Section 3.2

## 3.2 Notational conventions

The text shown by the online manual uses some notational conventions. The various overview tools indicate candidate documentation cards with a summary line. This line is of the form:

> <Identifier> <Formal Description> [``<Summary>'']

The `Identifier' is a single letter indicating the nature of the documentation card. The defined identifiers are: Browser (Manual Tool), Class, Example, Keyword, Method, Object, Predicate, Resource, Topic and Variable (instance-variable).

The `Formal Description' is a short description derived from the described object itself:

`V` class `-` selector: type | Variable that cannot be accessed directly
`V` class `<-` selector: type | Variable that may be read, but not written
`V` class `<->`selector: type | Variable that may be read and written
`V` class `->`selector: type | Variable that may only be written
`M` class `->`selector: type ... | Send-Method with argument-types
`M` class `<-` selector: type ... `-->`type | Get-Method with argument-types returning value of type
`R` Class.attribute: type | Class-variable with type

The same notational conventions are used in the running text of a card. See section 3.3.2.

### 3.2.1 Argument types

XPCE is a partially typed language. Types may be defined for both method arguments and instance variables. A type is represented by an instance of class type. XPCE defines a conversion to create type objects from a textual representation. A full description of this conversion may be found in the online manual (method `type`<-`convert'). In this document we will summarise the most important types:

- int
  XPCE integer datum.
- <low>..<high>, <low>.., ..<high>
  Range of integers (including <low> and <high>). The latter two constructs indicate one-side-unbound integer. Both <low> and <high> can also be floating point numbers, indication a `real-range'.
- any
  Both integers and objects. Function objects will be evaluated. See section 10.2.2.
- <class-name>
  Any instance of this class or one of its sub-classes. Class object is the root of the inheritance hierarchy. The type `object` is interpreted slightly different, as it does not accept instances of class function or its subclasses. This implies that the type `object` forces functions to be evaluated.
- `[`<type>`]`
  Either this type or @default. Trailing arguments to methods that accept @default may be omitted.
- <type>`*`
  Either this type or @nil.
- <type> `...`
  Methods with this type specification accept any number of arguments that satisfy <type>.
- {<atom1>,<atom2>, ...}
  Any of these name objects.

For example, the `->`initialise method of a graphical text object has type declaration:

    [char_array], [{left,center,right}], [font]

The first argument is an instance of class char_array, the super-class of name and string. The second argument either `left', `center' or `right' and the last argument is a font object. All arguments are between square brackets and may thus be omitted.