Is there an easy way to slice an array using an array of ranges? I'm 
looking for something like the following:

foo = [2,6,2,8,4,9]
some_ranges = UnitRange{Int64}[2:3, 5:6]
foo[some_ranges] # gives error; desired output is [6,2,4,9]

Reply via email to