Docs rewrite

This commit is contained in:
2026-07-03 10:23:45 +02:00
parent 6cda69044a
commit ec857525b4
23 changed files with 1084 additions and 1134 deletions
+30
View File
@@ -0,0 +1,30 @@
---
title: Variables
description: Variable declarations, mutability, type annotations, and destructuring.
icon: Variable
---
```mist
let x = 42; // Type-inferred immutable
let mut y = 10; // Mutable variable
i32 z = 100; // Explicit type annotation
str& s = "hello"; // Typed string reference
bool b = true; // Typed boolean
f64 f = 3.14; // Typed float
let (a, b) = (1, "two"); // Destructuring
let (x, (y, z)) = (1, (2, 3)); // Nested destructuring
```
Variable declarations follow either of two forms:
```mist
let <pattern> [= <expr>];
<type> <pattern> [= <expr>];
```
### Const and Static
```mist
const MAX: i32 = 100;
static NAME: str& = "hello";
```