Vision document for H1 2018

rumbu rumbu at rumbu.ro
Thu Mar 15 22:00:45 UTC 2018


On Thursday, 15 March 2018 at 21:10:47 UTC, flamencofantasy wrote:
> On Wednesday, 14 March 2018 at 05:22:53 UTC, rumbu wrote:
>
>> I doubt that this was the blocker because C# had 
>> ArraySegment<T> since .net framework 2.0 (2006), which is 
>> exactly a slice, but doesn't have the syntactic sugar for it.
>
> If it doesn't have the syntactic sugar how is it "exactly a 
> slice"?

This was about the fact that slices were a stopper for a D .net 
implementation.

The direct translation of the code here 
(https://dlang.org/articles/d-array-article.html#introducing-slices) is:

int[] a = new int[5];
var b = new ArraySegment<int>(a, 0, 2);
var c = new ArraySegment<int>(a, 3, 2);
c[0] = 4;
c[1] = 5;
c.CopyTo(b);

Surprise, the a content is the same as in D - [4,5,0,4,5].

I will stop my fallacy here, I promise this is the last post 
bragging about array segments, I feel some tension piling up on D 
forums and I don't want to contribute to it. My mistake was the 
use of the word "exactly".



More information about the Digitalmars-d-announce mailing list