Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Documenting vectors #255

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/language_concepts/00_data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,22 @@ fn main() -> pub Field {
}
```

### Vectors

A vector is a collection type similar to Rust's Vector type. It's convenient way to use slices as mutable arrays.

Example:

```rust
use std::collections::vec::Vec;

let mut vector: Vec<Field> = Vec::new();
for i in 0..5 {
vector.push(i);
}
assert(vector.len() == 5);
```

### Tuples

A tuple collects multiple values like an array, but with the added ability to collect values of
Expand Down