null [re: spec#]

foobar foo at bar.com
Sat Nov 6 04:30:56 PDT 2010


bearophile Wrote:

> foobar:
> 
> > Any type can be wrapped by an OPTION type. trying to do the converse of this is impractical and is bad design. 
> 
> Discussing this is a waste of time now, this part of the D language will probably never change.
> This is why other people and me are proposition something different.
> 
> Bye,
> bearophile

I haven't discussed syntax at all so to make clear: 
I'm not suggesting modifying existing pointers/references. 
I think D should add Non-Null references (maybe pointers too).

I MUCH prefer to use a T! or T@ or whatever syntax to denote non-null types than to disable constructors. 
Disabling stuff is a BAD design and is bug-prone. 
Prime example is Java's clone method which throws an exception by default. 
The language should be additive, i.e. I should be writing what I want to do, NOT listing all the possible things that I DON'T want to do. 


More information about the Digitalmars-d mailing list