Skip to content

Commit

Permalink
Merge pull request #1 from aurium/patch-1
Browse files Browse the repository at this point in the history
Missed literal declaration in 5.2.Array.md
  • Loading branch information
chai2010 authored Jun 22, 2024
2 parents 3b9e02f + ffaeb64 commit 6801c28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions en/5.CompositeTypes/5.2.Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Among them, `N` is the array length (a constant integer greater than 0), and `T`

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:
```wa
a: [3]i32 =
a: [3]i32 = [3]i32{13, 42, 9527}
println(a[0], a[1], a[2]) // 13 42 9527
```

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

Known issues:
- 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.
- 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.
- 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 comments on commit 6801c28

Please sign in to comment.