Hacker News new | ask | show | jobs
by dustyleary 3909 days ago
Thanks, my mistake.

I've been bit by this before. I sometimes wish you had to mark "reference-of" just like you have to mark "address-of" with &.

It's obvious that blah(&foo) might modify foo, without needing to examine the signature of blah().

The tradeoff is a bit of code clutter when you add a symbol (something like shared.compare_exchange_weak(%oldValue, oldValue * multiplier)), and a violation of DRY, since the information provided by this symbol would be redundant.