Skip to content

Commit 6801c28

Browse files
authored
Merge pull request #1 from aurium/patch-1
Missed literal declaration in 5.2.Array.md
2 parents 3b9e02f + ffaeb64 commit 6801c28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

en/5.CompositeTypes/5.2.Array.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Among them, `N` is the array length (a constant integer greater than 0), and `T`
1818

1919
Like many languages, Wa-lang use the `x[M]` syntax to access specific elements within an array. When declaring an array variable, you can use the following methods to set the initial value of the array element:
2020
```wa
21-
a: [3]i32 =
21+
a: [3]i32 = [3]i32{13, 42, 9527}
2222
println(a[0], a[1], a[2]) // 13 42 9527
2323
```
2424

@@ -68,4 +68,4 @@ Arrays with the same element type but different lengths are considered different
6868

6969
Known issues:
7070
- Bounds checking is not performed when accessing array elements via variable subscripts. This problem does not affect syntax compatibility. Subsequent corrections to this problem will not affect the existing source code. Developers using Wa-lang do not need to deal with this issue specially.
71-
- In the current version of the implementation, the array is expanded into a set of linear values. Therefore, when the array is assigned, the number of virtual registers and instructions is an integral multiple of the array length. If the length is too large, the size of the target code will expand rapidly. This problem does not affect syntax compatibility, and subsequent corrections to this problem will not affect existing source code. At this stage, program developers should pay attention to: except for global variables, try not to use arrays with a length greater than 8.
71+
- In the current version of the implementation, the array is expanded into a set of linear values. Therefore, when the array is assigned, the number of virtual registers and instructions is an integral multiple of the array length. If the length is too large, the size of the target code will expand rapidly. This problem does not affect syntax compatibility, and subsequent corrections to this problem will not affect existing source code. At this stage, program developers should pay attention to: except for global variables, try not to use arrays with a length greater than 8.

0 commit comments

Comments
 (0)