Updated docs to new version

This commit is contained in:
2026-07-12 07:55:13 -04:00
parent 59fec35aea
commit b419a1c7c7
7 changed files with 79 additions and 23 deletions
+19 -8
View File
@@ -5,14 +5,15 @@ 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
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
(i32, str&) as x, y = (1, "hello"); // Typed tuple destructuring
let (a, b) = (1, "two"); // Destructuring
let (x, (y, z)) = (1, (2, 3)); // Nested destructuring
```
Variable declarations follow either of two forms:
@@ -22,6 +23,16 @@ let <pattern> [= <expr>];
<type> <pattern> [= <expr>];
```
### Tuple Variable Declarations
Tuple variables can be declared with explicit type annotations using `as`:
```mist
(i32, bool) (x, y) as = (1, true);
i32 a, b = (1, 2, 3);
```
### Const and Static
```mist