logoalt Hacker News

zahlmantoday at 3:23 AM1 replyview on HN

So the language has reference semantics, and (per the edit) for every object (like in Python)?

(Ah, no, your example elsewhere in the thread suggests that the referred-to structures get implicitly copied all over the place.)


Replies

jcparkyntoday at 3:39 AM

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.

show 1 reply