On Fri, 14 Mar 2014 10:50:43 -0400, Dicebot <pub...@dicebot.lv> wrote:
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 that is very much a matter of your coding style. Many people
wouldn't notice any changes, and might even notice an improvement.
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
I think with the example Don showed, the above fix is not going to catch
all the problems. There is no easy grep fix.
I totally get that the effort is not worth the benefit currently. Just let
us know if we can help in any way when it becomes more of a realistic
priority. I would love to see the most obvious commercial D success story
on D2 :)
-Steve