Elegant way to initialise an array with discontinuous ranges

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:

Build a CatView and call collect or full on that?

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

Or [2015; 2025:2030; 2100]

3 Likes

I knew there was something already! thank you…