Reference¶
Notation¶
Types of functions¶
To specify types of the functions' arguments and types of their return values, I use the following notation:
(r
, g
, b
, a = 1.0
: 8bit
) → qolor
Read it as following:
- The function takes 4 arguments:
r
,g
,b
, anda
. - All arguments are of
8bit
type. - The
a
argument has default value1.0
. Thus, it can be omitted. - The return value of the function is of type
qolor
.
Parameters of functions¶
Having a function like this:
sum
: (x
, y
: real
) → real
we can invoke it as following:
Parameters of tagged literals¶
Having a tag like this:
sum
: (x
, y
: real
) → real
we can use it as following:
In other words:
- The whole literal is wrapped into backticks
`
- Parameters are specified between
${
and}
. - Every parameter is an expression, thus it can be not only number literals like in most examples but also may contain some calculations:
Resulting color¶
I use ⇒ #RRGGBB
or ⇒ #AARRGGBB
syntax everywhere to express the resulting color in examples as following: