Update deeply nested immutable structs.
Author jw3126
101 Stars
Updated Last
2 Years Ago
Started In
December 2017


Build Status

Update deeply nested immutable structs.


We plan to maintain Setfield.jl for a long time (written 2020-09-21). We will however not add new features. For an experimental stage successor, see Accessors.jl.


Updating deeply nested immutable structs was never easier:

using Setfield
@set obj.a.b.c = d

For more information, see the documentation and/or watch this video:

JuliaCon2020 Changing the immutable

Some creative usages of Setfield

  • VegaLite.jl overloads getproperty and lens API to manipulate JSON-based nested objects.

  • Kaleido.jl is a library of additional lenses.

  • PhaseSpaceIO.jl overloads getproperty and setproperties to get/set values from/in packed bits.