<aside> 💡 Owner: @Łukasz Czerwiński
</aside>
// TODO in documentation:
ask(arg1:int):string {
const factorial = fun(n:int):int {
if (n:lessThan(2)) {
return n
}
n:multiply(factorial(n:minus(1)))
}
const sum:int(int, int) = fun(a:int, b:int):int {
a:plus(b)
}
const one = 1
sum(one, arg1:factorial):toString
}
The result of the query above is 1 + arg1! (one plus factorial of arg1)
The whole code is enclosed in an ask
block:
ask {
... // here comes the whole code
}
The ask block might have a list of arguments, which defines the input data for the query.
The list of arguments is comma separated, each of them in format: <name>:<type>
, similar to functions (see below).
ask(maxAge:int, userName:string) {
...
}
When no arguments, no empty braces are required:
ask {
// is equivalent to:
ask() {
ask:string {
// is equivalent to:
ask():string {