Community

Appendices

Books

Migrating D1 Code to D2

There are many changes to the D programming language that affect
migrating source code from D1 to D2.
This is an outline of changes to look for and a guide to how to modify
the code.
See D 2.0 Enhancements for a complete list
of changes to the language.

In D1, a static array function parameter is passed by
reference, meaning a pointer to the start of the static array
is passed as an argument.
This means that any changes to the array contents made by the
function will be visible to the function's caller.
In D2, a copy of the whole static
array is passed as an argument. Changes to the array contents by
the function are not visible to the function's caller, as it is
a separate copy.