Slide 4 of 37

Variables and constants

proc main(): void {
	x := 1                     // inferred, immutable
	mut count := 0              // inferred, reassignable
	mut Str[dyn] rows = []       // annotated: says "dynamic"
	MAX := 100                  // a constant, by its shape alone

	count = count + 1
	append(rows, "first")
	echo "{x} {count} {rows} {MAX}"
}
:= infers a type from the value, including a static vector length. A type written out front with = states it instead, which is the only way to say [dyn], or to give a value nothing else says the shape of somewhere to land. A binding is immutable unless it says mut, and a mut variable may never be spelled UPPER_CASE — that shape is reserved for something nothing reassigns.