Setfield.jl
Setfield.jl copied to clipboard
Update deeply nested immutable structs.
I didn't see an existing way to check whether `get(obj, l)` would return a value or throw any or all of `ERROR: type $obj has no field $f` `BoundsError` `ArgumentError:...
I created https://github.com/JuliaFunctional/CompositionsBase.jl so that packages dealing with morphisms can share symbols like `⨟`, `compose`, and `opcompose` (an ASCII alias of `⨟`). As we discussed in https://github.com/tkf/Transducers.jl/issues/67, my motivation is...
If I have an array of immutable datastructures, it would be extremely advantageous from a performance perspective to be able to mutate that array in place instead of replacing it....
I don't how hard/annoying it is to change a package's name. But wouldn't it be more consistent with Julia to name the package "SetField" instead of "Setfield"? It is not...
Once `AbstractSparseMatrixCSC` API for accessors https://github.com/JuliaLang/julia/pull/33054 is settled, I'd like to add `set` definitions for them. It'll let us use something like ```julia @set nonzeros(A) = xs ``` The definition...
For example, I have the following code: ```julia struct M c end struct N d end struct A a::M b::N end x = A(M(1), N(2)) lens1 = @lens _.a.c lens2...
It occurred to me this morning that with the new `setproperty!/getproperty` methods, it might be possible to do something like: ```julia o = SettableRef(some_immutable_object) o.f.x = 10 o.f.y = 23...
Would it make sense for this package to support adding to named tuples? E.g. ```juila julia> nt = (x = 1, y = 2) (x = 1, y = 2)...
https://github.com/jw3126/Setfield.jl/pull/45#issuecomment-415987228