I prefer using Parameters.jl
because it provides also a nicer way the struct
s are displayed which is much nicer for debugging:
julia> using Parameters
julia> @with_kw struct A
a::Int=5
b::String="hello"
c::Float64
end;
julia> A(c=3.5)
A
a: Int64 5
b: String "hello"
c: Float64 3.5
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…