Non-null objects, the Null Object pattern, and T.init

Michel Fortin michel.fortin at michelf.ca
Fri Jan 17 12:42:12 PST 2014


On 2014-01-17 20:21:36 +0000, Jacob Carlborg <doob at me.com> said:

> On 2014-01-17 16:05, Michel Fortin wrote:
> 
>> This is basically what everyone would wish for a not-null type to do.
>> The syntax is clean and the control flow forces you to check for null
>> before use. Misuses result in a compile-time error.
> 
> Yes, exactly. But the issue is that the compiler needs to be modified for this.

Andrei's post was referring at language/compiler changes too: allowing 
init to be defined per-class, with a hint about disabling init. I took 
the hint that modifying the compiler to add support for non-null was in 
the cards and proposed something more useful and less clunky to use.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list