From 97d0583c92c733aa8497a99f5267d50151f6e965 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Jan 2026 23:54:29 +0000 Subject: fix(docs): replace remaining var references with let --- docs/PLUGINS.md | 2 +- docs/std/env.md | 10 +++++----- docs/std/fs.md | 6 +++--- docs/std/io.md | 4 ++-- docs/std/map.md | 6 +++--- docs/std/option.md | 4 ++-- docs/std/path.md | 4 ++-- docs/std/queue.md | 2 +- docs/std/result.md | 2 +- docs/std/string.md | 2 +- docs/std/vec.md | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) (limited to 'docs') 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 @@ -39,7 +39,7 @@ fn get(name: string) -> Option ### 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 @@ -47,7 +47,7 @@ fn get_dup(name: string) -> Option ### 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::new(); + let m = Map::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 { You can iterate over the map's key-value pairs using a `for` loop. ```zc -var m = Map::new(); +let m = Map::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::Some(10); + let val = Option::Some(10); if (val.is_some()) { println "{val.unwrap()}"; } - var nothing = Option::None(); + let nothing = Option::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::new(); + let q = Queue::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 { } 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::new(); + let v = Vec::new(); v.push(10); v.push(20); -- cgit v1.2.3