3 ms·
>While they're about it, they should also add immutable/copying data structures. They will start with records[1], but I think all value classes (Valhalla) shou
by BoyRobot777 6y ago
>While they're about it, they should also add immutable/copying data structures.
They will start with records[1], but I think all value classes (Valhalla) should have this functionality eventually.
You will be able to write:
record Point(int x, int y){}
Point pp = p with { x = 3; }
[1]https://github.com/openjdk/amber-docs/blob/master/eg-drafts/reconstruction-records-and-classes.md https://github.com/openjdk/amber-docs/blob/master/eg-drafts/...
- JulianMorrison 6y agoThis is definitely good, but I'm also meaning Clojure style lists, maps, etc where you can treat any given copy of the entire data structure as one big immutable value.