Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Making a Go program 70% faster with a one character change. Parent comment
b = a
b[0] = 3
print(a)
What does the above print? If the language implements reference semantics, it prints [3, 2]. If it implements value semantics, it prints [1, 2].
b = a
b[0] = 3
print(a)
What does the above print? If the language implements reference semantics, it prints [3, 2]. If it implements value semantics, it prints [1, 2].