Movement against float.init being nan
Timon Gehr
timon.gehr at gmx.ch
Mon Oct 9 00:03:24 UTC 2023
On 8/21/22 16:09, Dark Hole wrote:
>
> My point is making this by default for all primitive types. This will be
> consistent and simple:
> ```d
> bool x; // Error, use bool? or init it something meaningful
> struct Foo { bool x; } // Error too
> ```
> So we have no problem "programmers make meaningless 0" and have no
> problem to determine init for most of types.
I think a better way to approach this problem is to have a language
where people are not tempted to declare a variable into which they have
no sensible value to put in the first place. If you have no value at a
given point in the program, you should not need a variable to hold one.
More information about the Digitalmars-d
mailing list