Skip to content

Missed literal declaration in 5.2.Array.md #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading