diff --git a/README.md b/README.md index 771f9c0f..f618bcb1 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,8 @@ Liam is a strongly typed compiled language intended for performance comparable t ## Examples ### Hello world ```rust -fn print_string(s: string^): void { - // exact insertion into generated code - insert "println!(\"{}\", *s)"; -} - fn main(): void { - let s: string = "Hello world"; - print_string(@s); + print_string(@make_string(@"Hello world")); } ``` @@ -43,9 +37,9 @@ fn func_name(param: type): return_type {} ### For Loops ```rust -for ["car", "dog", "house"] { - print_u64(i); // generated index variable - i - print_string(it); // generated element variable - it +for str index in ["car", "dog", "house"] { + print_u64(index); + print_string(*str); } ``` @@ -57,6 +51,13 @@ struct struct_name { } ``` +### Conditionals +```rust +if condition or another_condition { + ... +} +``` + ### Array ```rust let arr : [type] = [...];