A fresh new minor release of ABS: always be shipping! 🚢
array.shuffle()
We've introduced a new array.shuffle()
function:
⧐ [1,2,3,4,5].shuffle()
[4, 5, 3, 2, 1]
array.reverse() operates on a copy of an array
We're in the process of making sure that functions that mutate arrays always operate on a copy of the array. This is somewhat of a breaking change but it also introduces an "expected" behavior (we align with Ruby here). You can expect other updates, in ABS 1.5, to align other array / string functions to this behavior.
Prior to this change:
⧐ a = [1,2,3,4,5]
⧐ a.reverse()
[5, 4, 3, 2, 1]
⧐ a
[5, 4, 3, 2, 1]
After this change:
⧐ a = [1,2,3,4,5]
⧐ a.reverse()
[5, 4, 3, 2, 1]
⧐ a
[1, 2, 3, 4, 5]
If you have older code that relies on mutating arrays in-place, you could migrate from x.reverse()
to x = x.reverse()
.