Hi,
This question is about programming style. I would like to know what's the
recommended way of writing getters and setters in Julia.
I have a TimeSignal class written in Matlab that I'm trying to port over to
Julia. In the Matlab implementation, I have some getter methods for
computing the values of the dependent properties (e.g., the number of
samples n_samples, the associated time vector time_vector, etc.). My
question is: what's the recommended way of implementing these getter
functions in Julia? Maybe implementing a getindex() function so that I can
do, for example, time_signal[:n_samples]? Or is it better to explicitly
write getter functions like get_n_samples(time_signal),
get_time_vector(time_signal), etc?
I read the thread about dot overloading at
https://github.com/JuliaLang/julia/issues/1974
but this still seems to be an open issue at the moment.
Thanks a lot,
Adriano