as - pannous/warp GitHub Wiki
The as keyword connects a value to a type.
In ordinary expressions it acts as cast operator:
pi as int == 3
After a call written without parentheses it casts the argument, as f 2 + 1 adds inside it:
f 2.2 as int is f(2.2 as int); to cast the result write (f 2.2) as int.
In variable and function declarations it types the reference:
person as string
is semantically equivalent to other familiar syntaxes:
person:string and
string person
The return type of a function is defined by the as keyword:
fib i as int:= if i<2 : 1 else fib(i-1) + fib i-2
Interestingly if the last parameter is untyped, the as keyword also weakly hints at the parameter type.