What happened to the "mutable struct" debate?

Mark Derricutt mark at talios.com
Fri Jan 23 04:16:06 UTC 2015


On 23 Jan 2015, at 16:31, Andrew Purtell wrote:

> Our mantra is “codes like a class, works like an int.”
> Stating the obvious, from a newcomer's perspective, ints are mutable.

Surely it's the *reference* to the int that's mutable, not the int itself.

5 = 0;
10 / 5 ->   DivByZero?  I think ( and hope ) not.

int v = 5
v = 0
10 / v -> DivByZero.


-- 
Mark Derricutt
http://www.theoryinpractice.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt


More information about the valhalla-dev mailing list