A comparison between Rust and D

maik klein via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 24 10:52:01 PDT 2016


On Friday, 24 June 2016 at 17:37:20 UTC, jmh530 wrote:
> On Friday, 24 June 2016 at 17:26:58 UTC, maik klein wrote:
>> https://maikklein.github.io/post/cmp-rust-d/
>>
>> https://www.reddit.com/r/programming/comments/4po2j5/a_comparison_between_rust_and_d/
>
> On interior mutability in arrays, does this help:
> void main()
> {
> 	immutable(int)[] x = [1, 2, 3];
> 	x = [2, 3, 4]; //this works
> 	x[0] = 1; //this doesn't
> 	
> 	immutable(int[]) y = [1, 2, 3];
> 	y = [2, 3, 4]; //this doesn't
> 	y[0] = 1; //this doesn't
> }

I should probably be more clearer, I this context I just meant 
std.container.Array.

And in general stuff like refcounted. I wonder how Andrej handles 
immutability for the refcounted string.


More information about the Digitalmars-d mailing list