julia> [ x<3 ? x : x>3 ? x^2 : 42 for x in 0:5]
7-element Vector{Int64}:
0
1
2
42
16
25
is simple and readily extendible.
julia> [ x<3 ? x : x>3 ? x^2 : 42 for x in 0:5]
7-element Vector{Int64}:
0
1
2
42
16
25
is simple and readily extendible.