I use a dictionary to store values : for example :
d = Dict() d["key1"] = Ions_frag(501.5, 1500, 3) Then to obtain the values : d["key1"].mz # = 501.5 My problem was to store many values in one object. So I found this solution, I don't know if it is the best and I hope this approach is correct ? :) Le mardi 12 juillet 2016 17:32:32 UTC+2, Jeffrey Sarnoff a écrit : > > You may be misreading the guidance. There is no advantage to putting a > parameter into the type when that parameter is not used anywhere. > > type Ions_frag > mz::Float64 > intensity::Float64 > charge::Int64 > end > if your use involves changing the fields' values after creating an > ions_frag typed variable > immutable Ions_frag > mz::Float64 > intensity::Float64 > charge::Int64 > end > > if your use constructs ions_frag variables appropriately initialized with > mz, intensity, charge; and then uses them as they are. > > On Tuesday, July 12, 2016 at 11:10:40 AM UTC-4, Fred wrote: >> >> I am referring to all 3, ie the type of Ions_frag :) >> Initially I used : >> >> type Ions_frag >> mz::Float64 >> intensity::Float64 >> charge::Int64 >> end >> >> and it works. But, after reading the documentation I "understood" that it >> is not optimal in performances. >> >> >> Le mardi 12 juillet 2016 16:59:57 UTC+2, Yichao Yu a écrit : >>> >>> >>> >>> Which one are you referring to? >>> >>> The one you have is a perfectly fine type. I'm not sure what do you >>> want to achieve. >>> >>>