func.orchid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- An Orchid program demonstrating the use of the `func!` keyword.
import! orchid.console;
import! orchid.string;
main! {
-- Functions are applied using parentheses.
call! console.write_line (greeting_for "Orchid");
}
-- Defines a new pure function.
func! greeting_for (name: String) -> String {
-- All functions must end with exactly one `return!` statement.
return! (string.combine "Hello, " name);
}