DIP 1018--The Copy Constructor--Formal Review
Atila Neves
atila.neves at gmail.com
Tue Feb 26 11:16:34 UTC 2019
On Tuesday, 26 February 2019 at 03:56:27 UTC, Walter Bright wrote:
> On 2/25/2019 7:45 AM, Atila Neves wrote:
>> I have no idea what people are talking about when they mention
>> on this forum that D's const is useless. Nearly every function
>> parameter in my code is `in`. Nearly every variable
>> declaration uses `const` instead of `auto`, the main exception
>> being when a function is constructing a value to return. Most
>> member functions I write are const or inout. I use const in D
>> as I do in C++: pretty much everywhere. Nearly every single
>> time a function parameter in my code isn't const is when it's
>> an input range.
>
> I'm going to make an educated guess that you're experienced at
> FP programming!
Indeed.
Functional is my default in any language. The good thing about D
is I can get my hands dirty when needed as opposed to jumping
through hoops or forcing me to use recursion when it doesn't fit
the problem (hello C++ metaprogramming).
I'd love it if functions were `@safe` and `pure` by default.
More information about the Digitalmars-d-announce
mailing list