Hacker News new | ask | show | jobs
by BoyRobot777 1925 days 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/...
1 comments

This 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.