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



--- Comment #4 from bearophile_h...@eml.cc 2010-11-04 13:41:10 PDT ---
This good document explains very the very well though-out design and
implementation of nonnullable reference types in Spec#:
http://research.microsoft.com/en-us/um/people/leino/papers/krml189.pdf

The article shows how to manage the nullable pointers/references with the help
of if statements, assertions and casts too.

It shows the need for annotations to denote both nullable and nonnullable
version of a type. In D the nullable version may use ? and the nonnullable
version may use @. So if T is a reference type parameter, then T is type
parameter itself (that might be a nullable or not type), T? is the nullable
version of T, and T@ is for the nonnullable version of T.

The document also suggests a shorter syntax to cast a variable to a nullable or
not nullable versione of its type:
cast(@)someRef
cast(?)someRef

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

Reply via email to