Skip to content
pannous edited this page Sep 30, 2021 · 1 revision

The as keyword connects a value to a type.

In ordinary expressions it acts as cast operator: pi as int == 3

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.

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally