Home

Awesome

Setfield

DocStable DocDev CI

Update deeply nested immutable structs.

Lifecycle

We plan to maintain Setfield.jl for a long time (written 2020-09-21, reinforced 2021-08-01, 2022-09-08, 2024-02-15). We will however not add new features. For a successor, see Accessors.jl.

Usage

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