immutable MyType{T}
    p1::T
    p2::T
    p3::T
end

M = Array(MyType{Int}, 2)

M[2].p1

--Tim


On Monday, September 29, 2014 05:08:35 AM [email protected] wrote:
> Dear all,
> 
> I'm an absolute beginner in julia, I tried to read the relevant part of the
> documentation but I'm still not quite sure how to solve my problem.
> I need to use structures -- a vector would do -- to which I can assign
> labels, an example being worth a thousand words, something like:
> 
> M = ["p1",  "p2", "p3"; 1, 2, 3]
> 
> I need to be able to call M[2,"p1"] to access the value of "p1", that is 1
> in the present case.
> 
> There does not seem to be a way to build composite arrays in julia, hence
> my question.
> 
> Any type of structures would do, but my aim is -- obviously -- to use the
> one that is most efficient.
> 
> Thanks a lot,
> 
> AS

Reply via email to