Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
jackburnergithub committed May 14, 2022
1 parent caddc33 commit 9e41c91
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
```

Expand Down Expand Up @@ -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);
}
```

Expand All @@ -57,6 +51,13 @@ struct struct_name {
}
```

### Conditionals
```rust
if condition or another_condition {
...
}
```

### Array
```rust
let arr : [type] = [...];
Expand Down

0 comments on commit 9e41c91

Please sign in to comment.