Julia | How to update immutable objects
It is often beneficial to have some data be immutable, so that any code that is manipulating that data is easier to reason with. However, sometimes it becomes necessary to update that data, in which case it can be cumbersome to have to make a copy each time.
In Julia, an easier way to make updates is to use the Setfield package [1], which enables the following grammar:
using Setfield
@set some_immutable_object.a.b.c = d
Resources: