Skip to content

Commit 9cd9022

Browse files
Merge pull request #544 from ProvableHQ/update/11-7-25
Update/11 7 25
2 parents 185ffc5 + 7ecd01a commit 9cd9022

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

documentation/language/03_data_types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ let m = Matrix::[2, 2] { data: [0, 1, 2, 3] };
233233
Note that generic structs cannot currently be imported outside a program, but can be declared and used in submodules. Acceptable types for const generic parameters include integer types, `bool`, `scalar`, `group`, `field`, and `address`.
234234

235235
## Option Types
236-
As of v3.3.0, Leo supports first-class option types using the `T?` syntax, where `T` is any of the types previously mentioned, exlucding `address`, `signature`, and `tuple`. A value of type `T?` can be initialized into two states: either a value of type `T`, or `none`:
236+
As of v3.3.0, Leo supports first-class option types using the `T?` syntax, where `T` is any of the types previously mentioned, excluding `address`, `signature`, and `tuple`. A value of type `T?` can be initialized into two states: either a value of type `T`, or `none`:
237237
```leo
238238
let w: u8? = 42u8;
239239
let x: u8? = none;

documentation/language/06_programs.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,38 +123,38 @@ Storage variable operations are only allowed in an [async function](#async-funct
123123

124124
Storage vectors behave like dynamic arrays of values of a given types. There are several functions available to query and modify storage vectors. The examples below will reference the following:
125125
```leo
126-
storage users: [address];
126+
storage id_numbers: [u64];
127127
```
128128

129129
### Querying
130-
To query the address currrently stored in `users` at index `idx`:
130+
To query the element currrently stored in `id_numbers` at index `idx`:
131131
```leo
132-
users.get(idx);
132+
id_numbers.get(idx);
133133
```
134-
To get the current length of `users`:
134+
To get the current length of `id_numbers`:
135135
```leo
136-
users.len();
136+
id_numbers.len();
137137
```
138138
### Modifying
139-
To set an address for at index `idx` in `users`:
139+
To set an element at index `idx` in `id_numbers`:
140140
```leo
141-
users.set(idx, value);
141+
id_numbers.set(idx, value);
142142
```
143-
To push an address onto the end of `users`:
143+
To push an element onto the end of `id_numbers`:
144144
```leo
145-
users.push(value);
145+
id_numbers.push(value);
146146
```
147-
To pop and return the last element of `users`:
147+
To pop and return the last element of `id_numbers`:
148148
```leo
149-
users.pop();
149+
id_numbers.pop();
150150
```
151-
To remove the element at index `idx`, return it, and replace it with the final element of `users`:
151+
To remove the element at index `idx`, return it, and replace it with the final element of `id_numbers`:
152152
```leo
153-
users.swap_remove(idx);
153+
id_numbers.swap_remove(idx);
154154
```
155-
To clear the every element in `users`:
155+
To clear the every element in `id_numbers`:
156156
```leo
157-
users.clear()
157+
id_numbers.clear()
158158
```
159159
:::note
160160
- `clear()` does not actually remove any values from the vector. It just sets the length to 0.

0 commit comments

Comments
 (0)