Option!T

Shammah Chancellor via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 2 05:18:39 PDT 2014


On 2014-07-02 12:04:03 +0000, Dicebot said:

> On Wednesday, 2 July 2014 at 11:48:18 UTC, Shammah Chancellor wrote:
>> I don't see a huge difference either.   I didn't realize Nullable was 
>> already around.  The main thing is that is valuable is that 
>> Nullable/Option extended to reference types, and then disabling the 
>> usual null assignment to references.
> 
> There is a very important difference when all other types considered 
> non-nullable - something we can only achieve by convention in D.

Well.   I'm not sure how much work it would be, but I'd like to 
investigate having a compiler flag that disables null references and 
leaves only null pointers available for C compatibility.  I think it 
would be an interesting experiment.   The D type system is certainly 
powerful enough to support going that direction (ala Rust, Haskell)

-Shammah



More information about the Digitalmars-d mailing list