I was initially using a bunch of constant globals. It worked well but it was a pain to store all the values compared to a dictionary. I have not tried an immutable yet though! Completely forgot about those as an alternative.
After reading the value types section again as well as reading some more examples I see where my initial understanding was off. Thanks for the help though! Going to test the immutable after a bit. > On 25 Apr 2016, at 15:56, Stefan Karpinski <[email protected]> wrote: > > What about setting up a bunch of const globals? > >> On Sun, Apr 24, 2016 at 8:43 AM, Tom Breloff <[email protected]> wrote: >> If it's always the same keys, maybe build an immutable type at the very >> beginning? >> >> >>> On Sunday, April 24, 2016, Michael Louwrens >>> <[email protected]> wrote: >>> I use a dictionary to store all the various variables I use in an >>> algorithm. >>> >>> So, there are many functions which look like: >>> function foo(input::Dict) >>> x =2*input[:bar] >>> end >>> >>> Input is created once and never changed. >>> Would abusing Val{T} be an option here? There will only be one value for >>> `input[:bar] for the entire run which takes > 2 hours. >>> >>> Thanks! >
