Arrays
Arrays are growable, indexed collections. Most operations return new arrays - the original stays untouched. push and pop are the exceptions, mutating in place.
Arrays are created with |
|
Access elements by index. |
|
|
|
|
|
|
|
Search operations. |
|
Iterate with |
|
|
|
$ pyr run arrays.pyr 10 50 5 [1, 2, 3, 4] 4 [1, 2, 3] [20, 30, 40] [10, 20, 30, 40, 50] [50, 40, 30, 20, 10] [10, 20, 30, 40, 50] true 3 false 10 20 30 40 50 150 |