{"body":"class ImmutableDS {\n   has $!last-return;\n   has $!field-value;\n   has $.some-field is rw;\n\n\n   method TWEAK(|) {\n      $!some-field := Proxy.new:\n         FETCH => method { my $tmp = $!last-return; $!last-return := Nil; $tmp // $!field-value },\n         STORE => method ($field-value) { $!last-return = self.new: :$field-value }\n      ;\n\n\n   }\n}\n\n\nmy ImmutableDS $immutable-data-structure .= new: :42field-value;\nmy $new-immutable-data-structure = $immutable-data-structure.some-field = 13;\nsay $new-immutable-data-structure.some-field;\nsay $immutable-data-structure.some-field;","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/2ASZxhQo","modified":1591178058,"id":"2ASZxhQo","size":579,"lines":21,"own_paste":false,"theme":"","date":1591178058}