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

> can be implemented like a persistent data structure

you don't get much benefit from persistent structures if every element of an array is modified, like in the examples in the post.




If the data structure has a reference count of one, you can safely mutate the data structure instead. Many persistent immutable data structure libraries use this as an additional optimization.


I missed that, sorry. Thanks for clarifying!




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

Search: