Skip to content
Snippets Groups Projects

Draft: Array slicing fix and modification

Open 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading