From 7929a798af5baae12c27298fa5b4795c328d8c99 Mon Sep 17 00:00:00 2001 From: sofia Date: Mon, 21 Jul 2025 20:23:37 +0300 Subject: [PATCH] Update examples a little bit --- README.md | 1 + reid_src/array_structs.reid | 4 ++-- reid_src/hello_world.reid | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef23342..00d2ee1 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Smaller features: - Easier way to initialize arrays with a single value - Lexical scopes for Debug Information - ~~Only include standard library at all if it is imported~~ +- Void-returns (`return;` for void-returning functions) ### Why "Reid" diff --git a/reid_src/array_structs.reid b/reid_src/array_structs.reid index 7203d03..3ffdc77 100644 --- a/reid_src/array_structs.reid +++ b/reid_src/array_structs.reid @@ -16,9 +16,9 @@ fn test() -> Test { fn main() -> u32 { let mut value = test(); - let mut a = value.second; + let mut a = &mut value; - a[2] = 15; + *a.second[2] = 15; return value.second[2]; diff --git a/reid_src/hello_world.reid b/reid_src/hello_world.reid index 89c62f7..aedbe0e 100644 --- a/reid_src/hello_world.reid +++ b/reid_src/hello_world.reid @@ -1,7 +1,8 @@ import std::print; fn main() -> i32 { - print("hello world"); + let test = "hello world"; + print(test); return 0; }