Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I happen to like the way Go did it, but now that generics and iterators have landed, it should be possible to create an always-make-a-copy vector type (although it'll need to use `get` and `set` like Java Lists, not [42] like slices/arrays).

It's not like you could have appended twice to the same List in Java and expected to get two disjoint arrays, unless you copy first, and `slices.Clone()` makes that easy in Go now too.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: