-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need MutationPolicy? #32
Comments
Let me get one step back first. If you want to modify an object
So
So I thought this case should be covered as well by Concerning dot-fusion support, what do you need? Do you want to update things with v = @SVector randn(3)
@set v[1:2] .= 42 For now my preference would be to get rid of support for 3. completely and only reintroduce it (via your suggestion or |
Thanks for the analysis. Yes, I think it makes sense to get rid of
Yes, I meant case 3. But case 2 is a requirement for it, so I also meant to add support for dotted assignments to |
BTW, as you asked me about my usage elsewhere, I just uploaded: https://github.com/tkf/Bifurcations.jl/blob/master/src/diffeq.jl It's a bifurcation analysis library. |
Cool, I will try it out! |
It's still a big mess right now :) Once it's stabilized, I'll perhaps make a PR to add a section something like "Who uses Setfield.jl" in README and put the link there. |
Continuing the discussion from #31 (comment)
Same here :) Meaning that I thought it'd be useful but have never used yet. I'm hoping to use it soon for writing generic code for mutable arrays and
StaticArray
. So I thought I'd fix it for 0.7. But I'm not entirely sure if I can write such code without handling the difference manually in the end.Also, for Setfield.jl to be usable in my code (especially with Julia 0.7), dot-fusions like
.=
and.+=
also have to be implemented which would add more complexity.Do you mean it's cumbersome to write policy-aware lens? Thinking out loud, how about putting the policy in
Lens
type? This way, you can define policy-unaware lens. Additional benefit would be that you can composeLens{EncourageMutation}
andLens{ForbidMutation}
in arbitrary nested way.The text was updated successfully, but these errors were encountered: