Skip to content

Draft: Array slicing fix and modification

chazfg requested to merge chazfg/ion:master into master

feat: Modified array slicing to support the expansion syntax as well as include array slicing with steps. The format is: [start..end..step]. Slightly different than in the issue

let arr = [{1...100}]

echo @arr[0...-1] -> 1, 2, 3, .. whole array (third period is inclusive)
echo @arr[0...-1..5] -> 5, 10, 15, ...
echo @arr[0...-1..-1] -> 100, 99, 98, ... (whole array reversed)
echo @arr[0...-1..-5] -> 100, 95, 90, ...

closes issue: #988

Edited by chazfg

Merge request reports