© Jørgen Steensgaard-Madsen, Copenhagen, 2006
Infix, postfix, and prefix notation                                                  

Operators for computing with values are used to build expressions from primitives that may be constants, names bound to values, or results of application of named operations. An operator symbols is typically a short sequence of special characters, e.g. >=.
The semantics of most operators are in most cases what one would expect with a high-scool background - except for the fact that computers are finite devices and cannot in general produce unbounded results (so addition is typically modulo some appropriate number and a representation mapping into an interval that includes negative numbers).
Some operators are introduced with special meanings as described below in comments to a formalised description with a main pattern as follows
[ operator-symbol(type,type):type ]
where the three types restrict left- and right operand values and tell about the result value type, respectively. Some cases are more involved and will be described when needed in the long list that follows.
A particular operator-symbol may appear in several descriptions and thus has several meanings. It is said to be overloaded. The actual types of seen operands determine the meaning of a particular application of the operator. An operator symbol is associated with some attributes that apply to all its meanings: the symbol's precedence (or 'binding strength') and associativity which together determine the structure of expressions that could be made more explicit by use of more parentheses. A third attribute characterise operator properties with respect to coercion, i.e. whether to look for a possible, implicit type conversion in certain cases (described elsewhere).
Type operators have names and combine types, rather than values. Some are defined internally:
void int real string Text Output
The following type operators are globally bound, i.e. should be predefined in some contribution. A number before a type operator name tells how many types are needed to form a type of the named kind - e.g. one type (the element type, possibly an array of integers) is required to determine a type of list values: int Array List
NONE  complex  Input  1 Array  1 List
2 Tuple  1 Option  1 Tree

The name NONE is used for absent operands (sort of a type of nothing which is slightly different from void).


The symbol ~ is used to indicate conversion between values of types string and Text. Output of a string value usually use the program notation with quotes around the significant text. Output of a Text value only reports the significant text. Note that embedded quotes will appear as you should want them to!
The symbol ?? denotes 3-way comparisons with results -1, 0, or 1 for less-than, equal-to, or greater-than zero, respectively. It is not intended to be used explicitly!
The symbol ? is the operator that may be omitted - and generally is so! Here it is introduced for concatenation of strings, or values that may be converted to strings automatically.
The following meanings of binary valued comparisons in terms of 3-way comparisons makes it easier to define comparisons for new types. They are introduced for no other reason.

Operation overview

The formal description of named operations differs from that of operators: here it suffices to compare to C-prototypes or routine headings as known from other programming languages. A full description is given elsewhere.


·Demo language
Implementation tool

General properties

·Somefix operators
Predefined type operators
Mutable variables
Functions for mathematics
File operations
Processes and connections
Misc. utilities
New type operators
Top-level entities

File translated from TEX by TTH, version 3.33.
On 18 Oct 2006, 16:47.
SourceForge.net Logo