mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 04:24:43 +00:00
Update array.er
This commit is contained in:
parent
df4e11ac77
commit
2e91472d0e
1 changed files with 1 additions and 1 deletions
|
@ -3,7 +3,7 @@ mut_content_arr = [1, 2, 3, 4, 5].into [Int!; 5]
|
||||||
telescoping_arr = [1, 2, 3, 4, 5].into [Int; !5]
|
telescoping_arr = [1, 2, 3, 4, 5].into [Int; !5]
|
||||||
mut_arr = [1, 2, 3, 4, 5].into [Int!; !5]
|
mut_arr = [1, 2, 3, 4, 5].into [Int!; !5]
|
||||||
|
|
||||||
mut_content_arr.map!(x -> x + 1)
|
mut_content_arr.map! x -> x + 1
|
||||||
# A mutable array class inherits an immutable array class, so a mutable array can compare with an immutable array
|
# A mutable array class inherits an immutable array class, so a mutable array can compare with an immutable array
|
||||||
assert mut_content_arr == [2, 3, 4, 5, 6]
|
assert mut_content_arr == [2, 3, 4, 5, 6]
|
||||||
# This is invalid: telescoping_arr.map!(x -> x + 1)
|
# This is invalid: telescoping_arr.map!(x -> x + 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue