ANN: Setfield.jl Yet another package for working with immutables

Why not make the inner constructor an outer constructor?

julia> struct B{T, X, Y}
           x::X
           y::Y
       end

julia> B{T}(x::X, y::Y = 2) where {T, X, Y} = B{T, X, Y}(x, y)

julia> b = B{1}(2,3)
B{1,Int64,Int64}(2, 3)

julia> using Setfield

julia> @set b.x = 512
B{1,Int64,Int64}(512, 3)