A slice can lose capacity simply by calling a function

Andrew Godfrey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 3 08:21:15 PDT 2015


> I really don't think that it's an issue in general, but if you 
> do want to
> guarantee that nothing affects the capacity of your array, then 
> you're going
> to need to either wrap all access to it

I agree with everything Jonathan said in both threads EXCEPT that 
this is not an issue.

The syntax "slice.capacity" gives the impression that 'capacity' 
is a property of the slice.

Such lack of consistency is a SERIOUS issue for D, especially 
when it occurs in something as basic as an array. One other place 
I see this problem is the semantics of utf8 strings.

This is DEADLY for D adoption. Personally, I think I'll be trying 
out Rust now, and checking back on these two issues later. This 
makes me sad, D is so promising ... but unfortunately the high 
standards it sets in many areas, are completely undercut by such 
basic problems. I work on large systems, and I can't imagine 
building a large system in this state.


More information about the Digitalmars-d-learn mailing list