diff options
| author | Zuhaitz <zuhaitz.zechhub@gmail.com> | 2026-01-20 18:12:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-20 18:12:21 +0000 |
| commit | 6165c437410052fa177fc1245c176ec6709a9da7 (patch) | |
| tree | 25ec43d4a2a51f96d90e0086ec6c0c2278fee0d6 /README.md | |
| parent | b2ea847ba2c5e124d629569290f6aa7381c089fd (diff) | |
Better wording (resource semantics)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -438,7 +438,7 @@ autofree var types = malloc(1024); Zen C treats types with destructors (like `File`, `Vec`, or malloc'd pointers) as **Resources**. To prevent double-free errors, resources cannot be implicitly duplicated. - **Move by Default**: Assigning a resource variable transfers ownership. The original variable becomes invalid (Moved). -- **Copy Types**: Simple Plain Old Data (int, Point, etc.) can opt-in to `Copy` behavior, making assignment a duplication. +- **Copy Types**: Types without destructors may opt-in to `Copy` behavior, making assignment a duplication. **Diagnostics & Philosophy**: If you see an error "Use of moved value", the compiler is telling you: *"This type owns a resource (like memory or a handle) and blindly copying it is unsafe."* |
