Symbols: binding and grouping
Interpunction and Grouping
- specifies
- infix: the right side is the implementation for
the thing on the left and is ended by an 'end' keyword.
- implies
- infix: the right side ...
-
- then
- infix: end of something followed (in time and order) by something else. Nota Bene: if the left side fails the right side will not be executed/evaluated
- separator
- infix: end of something followed (in order, but not neccessary in time) by something else. As soon as anything fails, the whole thing fails
- or
- infix: left or right can be valid. In case of a relation all possible combinations are checked until one matches, in all others the left side is evaluted first, and only if this fails the right side is evalueted
-
- its
- infix: specific sub element
- with-its
- infix, 'combines' the two variables: it is used as a '.' with the right side having to be a function call, then the left side is inserted as first parameter. Generally used for method calling.
-
- all
- postfix: all sub element
- aspect
- prefix/infix, compile time information of a type (and of variables of that type)
- range
- infix: a range of values
- etcetera
- postfix: this value (group) is repeated while needed
- force
- prefix: forces an action which would otherwise not be allowed
- prefix/semi-infix: indicates that this variable is going to get altered; the 'semi-infix' means that you can just say 'foo!bar' instead of 'foo.!bar'.
- boolean
- postfix: in case of a function call replaces a 'fail' action with an extra 'given' boolean; in case of a variable ...
- list
- is a collection of either enum-values, or variables with
their memory placement
- index
- is used to select a variable sub element of a collection
- closure
- is used for unnamed functions
Symbols
A symbol is an 'identifier' consisting of:
Relation Symbols
less-than ::= <
less-equal-than ::= <= | \u02264
greater-than ::= >
greater-equal-than ::= >= | \u02265
equal-to ::= =
identical-to ::= == | \u02261
not-less-than ::= /< | \u0226E
not-lessequal-than ::= /<= | \u02270
not-greater-than ::= /> | \u0226F
not-greatequ-than ::= />= | \u02271
not-equal-to ::= /= | \u02260
not-identical-to ::= /== | \u02262
true-relations ::= less-than | less-equal-than | greater-than
| greater-equal-than | equal-to | identical-to
false-relations ::= not-less-than | not-lessequal-than | not-greater-than
| not-greatequ-than | not-equal-to | not-identical-to
symbol-relation ::= true-relations | false-relations
Nota Bene: the not-xxx relations are not identical to their
logical
equivalent (for example not-less and greater-equal). The difference is in
their handling of invalid values (qv IEEE NaN).
Binairy Symbols
binary-and ::= /\
binary-or ::= \/
binary-xor ::= %
binary-not ::= ~
binary-shift-left ::= <<
binary-shift-right ::= >>
Value Symbols
increase-value ::= ++
decrease-value ::= --
Arithmatic Symbols
add ::= +
subtract ::= -
raise-to-power ::= **
multiply ::= *
divide ::= /
Other Symbols
Ocean itself only defines relation and order symbols:
all others are defined in the standard library.