Hacker News new | past | comments | ask | show | jobs | submit login

Like everything except "Ref returns and locals".

I don't think I've ever seen a case where I wished for that feature.

All the other things - tuples, anonymous out vars, pattern matching - I've found myself wanting quite often.




I believe ref returns are a performance feature. They seem a bit like move constructors in C++ in that they can save you a copy? But I am not confident I understand the nuances of move constructors to compare them properly.


They don't move anything, they are either pointers to a value on the stack or to a field in an object on the heap. The first is more like how standard C++ references are usually used, and the second are interior pointers like Go has. No code gets executed to make them happen, and no data is copied.




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

Search: