Echo Writes Code

bind.orchid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- An Orchid program demonstrating the use of the `bind!` keyword.

import! orchid.console;

-- Binds an identifier to an expression. This is syntactic sugar for declaring a function that
-- returns the expression.
bind! global_message = "Hello, Orchid!";

main! {
	-- `bind!` can be used to bind local identifiers, too.
	bind! message = global_message;

	-- Bound identifiers can be used as expressions in other statements and expressions.
	call! console.write_line message;
}