Accessors.jl icon indicating copy to clipboard operation
Accessors.jl copied to clipboard

@reset naming convention

Open rveltz opened this issue 2 years ago • 4 comments

Hi,

If I understand well, the macro @reset is the equivalent of Setfield.@set!.

Why did you chose to remove the !

Thank you

rveltz avatar May 30 '23 14:05 rveltz

I did not like @set! because the ! usually means mutation. But instead the macro rebinds the variable, without any mutation.

jw3126 avatar May 30 '23 16:05 jw3126

Also, I had some vague plans to use @set! for actual mutation, but that never happened so far.

jw3126 avatar May 30 '23 16:05 jw3126

I am asking this because I use a lot @set! in BifurcationKit and I am thinking moving to Accessors

rveltz avatar May 30 '23 16:05 rveltz

See also this thread https://github.com/JuliaObjects/Accessors.jl/pull/93#discussion_r1152964082 for set!/reset discussion.

aplavin avatar May 30 '23 17:05 aplavin