Possible change to array runtime?

Dicebot public at dicebot.lv
Fri Mar 14 07:50:43 PDT 2014


On Thursday, 13 March 2014 at 17:18:05 UTC, Steven Schveighoffer 
wrote:
>> I think there's a much simpler approach that could help. 
>> Define and document a function clearForAppend that resets the 
>> length to 0 and puts the array in gear for appending. Maybe an 
>> optional parameter indicates a minimum desired capacity.
>>
>> Then people who want to migrate from D1 to D2 or generally 
>> consider using this idiom can grep their source code for 
>> "length *= *0" and make the change on their own pace and with 
>> appropriate testing.
>
> Arguably this is already possible within a project, such as 
> Sociomantic's. They haven't done it yet. I don't know why.
>
> -Steve

It has not been mentioned as example of blocker but example of 
most horrible breaking change that can happen if dmd user is not 
aware of it before upgrade.

I think only practical thing that blocks D2 transition right now 
is that no one can afford to work on it full-time and amount of 
changes needed is too big to be done as a side work - array 
stomping is not only problematic area, I personally think const 
will cause much more problems.

Really hope that with recent hires doing a focused porting effort 
will soon become a real option. D1 is so D1 :P


More information about the Digitalmars-d mailing list