logoalt Hacker News

jcparkyntoday at 3:39 AM1 replyview on HN

Nope, it's value semantics (unlike Python), the references are just an internal optimization. Implicit copies happen when a list/dict with more than one reference is mutated.


Replies

zahlmantoday at 4:23 AM

> the references are just an internal optimization

Optimization specifically for function calls, or... ?

Because if you're doing all this copy-on-write anyway, the indirection seems to be a needless cost in other contexts.

show 1 reply