What happened to the "mutable struct" debate?

Vitaly Davidovich vitalyd at gmail.com
Fri Jan 23 16:20:50 UTC 2015


For the record (again), I'd support and like mutable structs in java.  They
wouldn't be used often (and aren't in .NET) but they're useful for some
scenarios.  Yes, they're subtle at times but so is, e.g., multithreading.

sent from my phone
On Jan 23, 2015 11:17 AM, "Simon Ochsenreither" <simon at ochsenreither.de>
wrote:

> > If mutable structs are not allowed to be passed by ref, then one is more
> > likely to lose writes as the struct is passed through a method chain.
> > There's no *necessity* per say, but the danger zone is expanded.
>
> +1.
>
> Not sure why people are eager to repeat a mistake which is deeply
> regretted by
> its inventors. Together with not having statics with class-level generics,
> it's
> one of the few things which are better than .NET.
>


More information about the valhalla-dev mailing list