3 ms·
Yet it says [1]: > Arrays and the elements of arrays are also immutable I guess the docs need a bit of rewording. Forcing a deep-copy on variable assignment d
by abiogenesis 6y ago
Yet it says [1]:
> Arrays and the elements of arrays are also immutable
I guess the docs need a bit of rewording. Forcing a deep-copy on variable assignment does not mean the variable itself is immutable.
[1] https://chaos-lang.org/docs/07_immutability https://chaos-lang.org/docs/07_immutability
- catlifeonmars 6y agoAh, I did not dive that deep. Now I am curious what the impact of deep copies on performance is, and if the language employs any clever optimizations to improve performance.
- abiogenesis 6y agoI don't see how you can reliably deep copy any user defined class either.
- lgessler 6y agoThere are none, at least in the familiar OOP sense: > Chaos language is not object-oriented. So everything is done by functions and data types.
- deleted 6y ago[deleted]
- agentultra 6y agoTurns out that immutable data structures can share a lot of structure safely. https://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki-ebook/dp/B00AKE1V04 https://www.amazon.com/Purely-Functional-Structures-Chris-Ok...
- catlifeonmars 6y agoAs an aside, rebinding local references can be viewed as a form of mutability.