ideas about ranges

Rainer Deyke rainerd at eldwood.com
Fri May 22 18:33:41 PDT 2009


Jason House wrote:
> Do you have any common cases where a range would generate nulls as part of 
> its normal output?  I think using the natural null feature of reference 
> types is a clean and reasonable solution.

Iterating over an array that contains nulls?

Nullable!(T) must be able to hold all values of T, plus null.  By
inference, Nullable!(Nullable!(T)) must be able to hold all values of T,
plus two different null values.  'Maybe' in Haskell can do this.  (The
two null values are called 'Nothing' and 'Just Nothing'.)
'boost::optional' in C++ can do this.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list