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

Commit

Permalink
Merge pull request #255 from noir-lang/zpedro/slices
Browse files Browse the repository at this point in the history
Documenting vectors
  • Loading branch information
signorecello authored Aug 2, 2023
2 parents 6be98b3 + 54d98d6 commit fe452a4
Showing 1 changed file with 16 additions and 0 deletions.
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 @@ -225,6 +225,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

0 comments on commit fe452a4

Please sign in to comment.