Skip to content

Commit

Permalink
minimal docs
Browse files Browse the repository at this point in the history
  • Loading branch information
serkonda7 committed Jan 5, 2025
1 parent b0da581 commit 60b6e8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes are documented in this file.

## 0.0.9 - unreleased
### New Language Features
- Array slicing using range indexing: `arr[low..high]`

### Error Checks
- Warn if return value of function is unused
- IndexExpr: Check index type
Expand Down
11 changes: 11 additions & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ It's also possible to preallocate an array with a fixed length:
a := []i32{ length = 3 }
```

#### Array Slicing (Range Indexing)
```bait
nums := [0, 10, 20, 30]
println(nums[1..3]) // [10, 20]
println(nums[..3]) // [0, 10, 20]
println(nums[2..]) // [20, 30]
println(nums[..]) // [0, 10, 20, 30]
```


### Maps
You can initialize a map with the short literal syntax:
```bait
Expand Down

0 comments on commit 60b6e8c

Please sign in to comment.