In D code it's a good idea to set as const/immutable (where
possible) all variables that don't need to change, for both
safety and compiler-enforced code documentation.
In my D functions sometimes I create dynamic arrays that later
don't have to change length nor to be reassigned, but I have to
On Friday, 28 November 2014 at 10:55:27 UTC, bearophile wrote:
In D code it's a good idea to set as const/immutable (where
possible) all variables that don't need to change, for both
safety and compiler-enforced code documentation.
In my D functions sometimes I create dynamic arrays that later
Dominikus Dittes Scherkl:
Why you don't use static arrays for such a purpose?
I thought this is exactly what they are made for, aren't they?
Currently you can't create a static array with a length known
only at run-time. And passing around a fixed-size arrays has some
costs.
Bye,
On Friday, 28 November 2014 at 10:55:27 UTC, bearophile wrote:
In D code it's a good idea to set as const/immutable (where
possible) all variables that don't need to change, for both
safety and compiler-enforced code documentation.
In my D functions sometimes I create dynamic arrays that later