Open ohno opened 3 days ago
I want to display variable names when displaying struct. Please refer to the discourse.
Current:
julia> HO = HarmonicOscillator(k=1.0, m=1.0, ℏ=1.0) HarmonicOscillator(1.0, 1.0, 1.0)
Goal:
julia> HO = HarmonicOscillator(k=1.0, m=1.0, ℏ=1.0) HarmonicOscillator(k=1.0, m=1.0, ℏ=1.0)
Overwriting dump() to Base.show() is enough if we ignore executability:
dump()
Base.show()
julia> Base.show(io::IO,model::HarmonicOscillator) = dump(model) julia> HO = HarmonicOscillator(k=1.0, m=1.0, ℏ=1.0) HarmonicOscillator k: Float64 1.0 m: Float64 1.0 ℏ: Float64 1.0
In any case, this struct contains information about the variable names and their values.
I want to display variable names when displaying struct. Please refer to the discourse.
Current:
Goal:
Overwriting
dump()
toBase.show()
is enough if we ignore executability:In any case, this struct contains information about the variable names and their values.