Skip to content

Commit 6e149a4

Browse files
authored
Merge pull request #533 from ProvableHQ/IGI-111/empty-array
Add docs for empty arrays
2 parents 4fc945d + 30ce3c4 commit 6e149a4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

documentation/guides/07_devnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ leo query transaction {TRANSACTION_ID}
143143

144144
The transaction API endpoint is instructive in verifying whether a transaction succeeded or failed. Since both successful and failed transaction execute a fee transaction, if only the fee transaction appears, that is a clear indication that the transaction has failed. Note that on the Testnet and on Mainnet, failed transactions still require a fee since the network is performing a computation.
145145

146-
A full list of API endpoints is available [here](https://developer.aleo.org/apis/provable-api)
146+
A full list of API endpoints is available [here](https://developer.aleo.org/apis/v2/provable-api)
147147

148148
## Record Scanning
149149

documentation/language/03_data_types.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ program test.aleo {
154154

155155
### Array
156156

157-
Leo supports static arrays. Array types are declared as `[type; length]` and can be nested. Arrays cannot be empty nor modified.
157+
Leo supports static arrays. Array types are declared as `[type; length]` and can be nested.
158158

159159
Arrays only support constant accesses. The accessor expression must be a constant expression.
160160

@@ -169,6 +169,9 @@ let arr: [bool; 4] = [true, false, true, false];
169169
// Nested array
170170
let nested: [[bool; 2]; 2] = [[true, false], [true, false]];
171171
172+
// Empty array
173+
let empty: [u32; 0] = [];
174+
172175
struct Bar {
173176
data: u8,
174177
}
@@ -207,7 +210,7 @@ transition sum_with_loop(a: [u64; 4]) -> u64 {
207210

208211
### Tuple
209212

210-
Leo supports tuples. Tuple types are declared as `(type1, type2, ...)` and can be nested. Tuples cannot be empty or modified.
213+
Leo supports tuples. Tuple types are declared as `(type1, type2, ...)` and can be nested. Tuples cannot be empty.
211214

212215
Tuples only support constant access with a dot `.` and a constant integer.
213216

documentation/language/08_cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Declaring `arrays`
125125
```leo
126126
let arrb: [bool; 2] = [true, false];
127127
let arr: [u8; 4] = [1u8, 2u8, 3u8, 4u8];
128+
let empty: [u8; 0] = [];
128129
```
129-
**Arrays cannot be empty.**
130130

131131
Accessing elements
132132
```leo
@@ -154,7 +154,7 @@ Declaring tuples
154154
```leo
155155
let t: (u8, bool, field) = (42u8, true, 100field);
156156
```
157-
**Tuples cannot be empty or modified. Same with arrays.**
157+
**Tuples cannot be empty.**
158158

159159
Accessing tuple elements
160160

0 commit comments

Comments
 (0)