nostr:npub1k976fcfxdm6m7nwy4c4zkpjh0yatq9atulvwd45mmg7pm85q8mnqzsn2v4 Yea thats one solution, but thats a lot of additional code you now need to do, and doesnt give you the option of switching between mutable and unmutable versions without more code.

Again there are solutions, but most of them arent very elegant.

In an ideal world an object would be mutable by default, but can be made to be immutable. You pick what makes sense for the scenario. Ideally without needing to write a lot of boilerplate code. For this solution you'd need different methods entierly for the mutable way of changing an object vs the immutable change-and-copy way.

Reply to this note

Please Login to reply.

Discussion

No replies yet.