jw3126 / Setfield.jl

Update deeply nested immutable structs.
Other
167 stars 17 forks source link

@set doesn't change the field #76

Closed mleprovost closed 5 years ago

mleprovost commented 5 years ago

Hello,

Here is an example of the issue I got:

julia> using Setfield
struct AB
    a
end
l = @lens _.a

julia> obj = AB(3)
AB(3)

julia> @set obj.a = 42
AB(42)

julia> obj
AB(3)

I 've hoped that obj will be change to AB(42)

mleprovost commented 5 years ago

Sorry, I found the answer to my question https://github.com/jw3126/Setfield.jl/issues/22