# Pastebin LINH7g9T class ImmutableDS { has $!last-return; has $.field-value; has $.some-field is built(:bind) is rw = Proxy.new: FETCH => -> $ { my $tmp = $!last-return; $!last-return := Nil; $tmp // $!field-value }, STORE => -> $, $field-value { $!last-return = self.clone: :$field-value } ; } my ImmutableDS $immutable-data-structure .= new: :42field-value; my $new-immutable-data-structure = $immutable-data-structure.some-field = 13; say $new-immutable-data-structure.some-field; say $immutable-data-structure.some-field;