Struct with default ctor (Was: [dmd-beta] dmd 2.064 beta take 2)
Timon Gehr
timon.gehr at gmx.ch
Sun May 19 05:22:38 PDT 2013
On 05/19/2013 06:57 AM, Walter Bright wrote:
>> D already have thing like Nullable in the standard lib. Introducing
>> Maybe is
>> also pretty easy. Adding NonNullable in addition to Nullable sound like
>> something is not quite right.
>
> Nullable is something different - it exists to give a 'null' value to
> things that don't have a null representation, like an int.
>
Type Object ought not to have a "null representation" either.
> C#, for example, has a Nullable type constructor, but it still has
> object references that can be null. C# has no standard way to produce a
> non-nullable object reference.
>
> There's no non-null wrapper in Java, either.
This limits those languages' static type safety as much as D's.
More information about the Digitalmars-d
mailing list