Let's say I want to represent the result of the following, but using 
literal syntax:

v=Vector{FloatRange{Float64}}(3)
v[1] = 1.0:0.5:2.0
v[2] = 3.0:0.1:4.0
v[3] = 5.0:0.2:6.0

In other words, I want to generate this:

3-element Array{FloatRange{Float64},1}:
>  1.0:0.5:2.0
>  3.0:0.1:4.0
>  5.0:0.2:6.0


What is the equivalent way to write this using literal syntax?

This doesn't work: 

    Vector{FloatRange{Float64}}([1.0:0.5:2.0, 3.0:0.1:4.0, 5.0:0.2:6.0])

Because:

    [1.0:0.5:2.0, 3.0:0.1:4.0, 5.0:0.2:6.0] 

Just turns into a 20-element Array{Float64,1} !!!

Which is confusing because this works fine:

   Vector{ASCIIString}(["Consistent", "Syntax", "Matters"])

And so does this:

    Vector{Float64}([0.1, 0.2, 0.3])

I'm sure there is a trivial way to do this, but I'm missing the obvious, 
obviously :-)

Reply via email to