Elegant way to initialise an array with discontinuous ranges

question

#1

I need an array of integers with different values, e.g. [2015, 2025-2030,2100]

What I am doing now:
y = [2015]; append!(y,collect(2025:2030)); append!(y,2100)

Is there a better way? (it would be nice collect(2015,2025-2030,2100) but it doesn’t work :slight_smile:


#2

Build a CatView and call collect or full on that?


#3
vcat(2015, 2025:2030, 2100)

#4

Or [2015; 2025:2030; 2100]


#5

I knew there was something already! thank you…