summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSteven <burnett@posteo.de>2026-01-25 23:54:29 +0000
committerSteven <burnett@posteo.de>2026-01-25 23:54:29 +0000
commit97d0583c92c733aa8497a99f5267d50151f6e965 (patch)
tree825c006266bf3a57ab4dbb2d3d7df2f9d9dcc21d /docs
parenta5e8a3734fd850de53ad917d55ee5c2e73f39190 (diff)
fix(docs): replace remaining var references with let
Diffstat (limited to 'docs')
-rw-r--r--docs/PLUGINS.md2
-rw-r--r--docs/std/env.md10
-rw-r--r--docs/std/fs.md6
-rw-r--r--docs/std/io.md4
-rw-r--r--docs/std/map.md6
-rw-r--r--docs/std/option.md4
-rw-r--r--docs/std/path.md4
-rw-r--r--docs/std/queue.md2
-rw-r--r--docs/std/result.md2
-rw-r--r--docs/std/string.md2
-rw-r--r--docs/std/vec.md2
11 files changed, 22 insertions, 22 deletions
diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md
index ea21485..5e78d29 100644
--- a/docs/PLUGINS.md
+++ b/docs/PLUGINS.md
@@ -13,7 +13,7 @@ import plugin "regex" as re
// or simple: import plugin "regex" (uses "regex" as identifier)
fn main() {
- var valid = re! { ^[a-z]+$ };
+ let valid = re! { ^[a-z]+$ };
}
```
diff --git a/docs/std/env.md b/docs/std/env.md
index 09ece60..dd56e4f 100644
--- a/docs/std/env.md
+++ b/docs/std/env.md
@@ -10,7 +10,7 @@ import "std/env.zc"
fn main() {
Env::set("HELLO", "world");
- var hello = Env::get("HELLO");
+ let hello = Env::get("HELLO");
if (hello.is_some()) {
println "Hello {hello.unwrap()}";
@@ -31,7 +31,7 @@ enum EnvRes {
### get
-Retrieves the env-var as borrowed string (char *) (no alloc)
+Retrieves the env-variable as borrowed string (char *) (no alloc)
```zc
fn get(name: string) -> Option<string>
@@ -39,7 +39,7 @@ fn get(name: string) -> Option<string>
### get_dup
-Retrieves the env-var as caller-owned String() (heap alloc)
+Retrieves the env-variable as caller-owned String() (heap alloc)
```zc
fn get_dup(name: string) -> Option<String>
@@ -47,7 +47,7 @@ fn get_dup(name: string) -> Option<String>
### set
-Sets an env-var variable
+Sets an env-variable
```zc
fn set(name: string, value: string) -> EnvRes
@@ -55,7 +55,7 @@ fn set(name: string, value: string) -> EnvRes
### unset
-Unsets an existing env-var
+Unsets an existing env-variable
```zc
fn unset(name: string) -> EnvRes
diff --git a/docs/std/fs.md b/docs/std/fs.md
index 8aea0f5..42d10c4 100644
--- a/docs/std/fs.md
+++ b/docs/std/fs.md
@@ -9,10 +9,10 @@ import "std/fs.zc"
fn main() {
// Reading a file
- var res = File::open("example.txt", "r");
+ let res = File::open("example.txt", "r");
if (res.is_ok()) {
- var file = res.unwrap();
- var content = file.read_to_string();
+ let file = res.unwrap();
+ let content = file.read_to_string();
if (content.is_ok()) {
println "{content.unwrap()}";
}
diff --git a/docs/std/io.md b/docs/std/io.md
index 825728d..7f46940 100644
--- a/docs/std/io.md
+++ b/docs/std/io.md
@@ -12,11 +12,11 @@ fn main() {
io.println("Hello %s", "World");
// Formatting strings
- autofree var s = io.format_new("Value: %d", 42);
+ autofree let s = io.format_new("Value: %d", 42);
// Reading input
io.print("Enter name: ");
- autofree var name = io.readln();
+ autofree let name = io.readln();
}
```
diff --git a/docs/std/map.md b/docs/std/map.md
index f8bd76a..08949bd 100644
--- a/docs/std/map.md
+++ b/docs/std/map.md
@@ -8,13 +8,13 @@
import "std/map.zc"
fn main() {
- var m = Map<int>::new();
+ let m = Map<int>::new();
m.put("one", 1);
m.put("two", 2);
if (m.contains("one")) {
- var val = m.get("one");
+ let val = m.get("one");
println "{val.unwrap()}";
}
@@ -45,7 +45,7 @@ struct Map<V> {
You can iterate over the map's key-value pairs using a `for` loop.
```zc
-var m = Map<int>::new();
+let m = Map<int>::new();
m.put("a", 1);
for entry in m {
diff --git a/docs/std/option.md b/docs/std/option.md
index a048b00..fbbc296 100644
--- a/docs/std/option.md
+++ b/docs/std/option.md
@@ -8,13 +8,13 @@
import "std/option.zc"
fn main() {
- var val = Option<int>::Some(10);
+ let val = Option<int>::Some(10);
if (val.is_some()) {
println "{val.unwrap()}";
}
- var nothing = Option<int>::None();
+ let nothing = Option<int>::None();
println "{nothing.unwrap_or(0)}"; // Prints 0
}
```
diff --git a/docs/std/path.md b/docs/std/path.md
index 0be30fd..798144a 100644
--- a/docs/std/path.md
+++ b/docs/std/path.md
@@ -8,8 +8,8 @@
import "std/path.zc"
fn main() {
- var p = Path::new("/home/user");
- var full_path = p.join("docs/file.txt");
+ let p = Path::new("/home/user");
+ let full_path = p.join("docs/file.txt");
println "Full path: {full_path.c_str()}";
diff --git a/docs/std/queue.md b/docs/std/queue.md
index d463f15..c7db3fd 100644
--- a/docs/std/queue.md
+++ b/docs/std/queue.md
@@ -8,7 +8,7 @@
import "std/queue.zc"
fn main() {
- var q = Queue<int>::new();
+ let q = Queue<int>::new();
q.push(1);
q.push(2);
diff --git a/docs/std/result.md b/docs/std/result.md
index 1f9390e..da60b8d 100644
--- a/docs/std/result.md
+++ b/docs/std/result.md
@@ -15,7 +15,7 @@ fn divide(a: int, b: int) -> Result<int> {
}
fn main() {
- var res = divide(10, 2);
+ let res = divide(10, 2);
if (res.is_ok()) {
println "Result: {res.unwrap()}";
} else {
diff --git a/docs/std/string.md b/docs/std/string.md
index 252b737..ae4b738 100644
--- a/docs/std/string.md
+++ b/docs/std/string.md
@@ -8,7 +8,7 @@
import "std/string.zc"
fn main() {
- var s = String::from("Hello");
+ let s = String::from("Hello");
s.append(String::from(" World"));
println "{s}"; // Prints "Hello World"
diff --git a/docs/std/vec.md b/docs/std/vec.md
index 1b48361..7bc7c05 100644
--- a/docs/std/vec.md
+++ b/docs/std/vec.md
@@ -15,7 +15,7 @@
import "std/vec.zc"
fn main() {
- var v = Vec<int>::new();
+ let v = Vec<int>::new();
v.push(10);
v.push(20);