logoalt Hacker News

eptcyka • today at 3:56 PM • 1 reply • view on HN

Would it then be possible to mutably reference two entries in the same hashmap?


Replies

verdagon • today at 6:22 PM

Yep, that comes for free from the model. Though, if you're asking if we can have two unique references (like `&mut`) to two different entries, not yet. Nick's original proposal had some thoughts on how we can do that, and Zeta (another language implementing group borrowing) has some neat dependent-type-ish mechanisms for that. I'm still considering what Valen will want to do there.

Edit: it turns out, Ante has path unions! https://www.reddit.com/r/ProgrammingLanguages/comments/1x37b...