Echo Writes Code

create_update.orchid

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- An Orchid program demonstrating the use of the `create!` and `update! keywords.

import! orchid.console;

main! {
	-- Mutable data can be initialized via the `create! NAME = EXPR;` statement. Unlike identifiers
	-- bound with `bind!`, those bound with `create!` may later be passed to the `update!` statement to
	-- edit their value.
	create! message = "Hello, ";

	-- The `update! NAME = EXPR;` statement edits the data stored in a mutable binding.
	update! message = message + "Orchid!";

	-- Mutable bindings can be passed to procedure invocations exactly the same way that immutable ones can.
	call! console.write_line message;
}