[Issue 4571] Non-null class references/pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 26 16:42:08 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4571



--- Comment #1 from bearophile_hugs at eml.cc 2010-08-26 16:41:58 PDT ---
This is just half of a solution. Beside introducing nonnull
pointers/references, and a handy syntax to denote them, to have a null-safe
language you also need to require explicit tests every time a nullable
pointers/references is about to be dereferenced, and then after this test in
the else branch the reference type "becomes" a non-nullable one.

This is an application of the idea of "TypeState", used by the Mozilla Rust
language. The type doesn't actually change, it's just its state that change.

More on the concept of TypeState (at the moment it is not present in
Wikipedia):
http://www.google.com/search?q=typestate

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list