Issue #1: Allocate Arrays in a single line.
It should be possible to do the following in a single line. Even Python allows this via 5*["default value"]
Code: Select all
a := []
a.length := 5
.sort() - Should be able to sort array element. Also, should accept a user defined sorting function.
.apply() - Should be able to apply a user defined function to each element of the array.
.fold() - Would allow for some simple functions such as sum(). Make it left to right to avoid lfold and rfold, the user can specify .reverse().
.count() - Counts the number of times an element occurs.
.reverse() - To make iterating backwards possible.
Less Important but still useful:
- Perhaps setting a zero element turns it into a zero-indexed array.
- Not sure what to do with IndexError and a[100]?