Specification for Nullable [Kit George]

Specification for Nullable [Kit George]

  • Comments 8

I thought I'd make the Nullable specification available to everyone, for reference, and in order to allow you to ask any questions/issues. This is about to go through an ECMA review as well, so it should be interesting to see what their issues/comments are.

I've posted the specification on http://www.gotdotnet.com/team/clr/bcl/general/nullable2.doc. We'll continue to make more specifications available as we get closer to shipping!

  • What is "cheops" ?
  • I cannot believe it has come to this...I am reading specs!
  • Aaaaah, Julia...

    Think of it as advance documentation for the type ;-)
  • Ricky, Cheops is a Network User Interface, commonly referred to as 'The Swiss Army Knife' for unifying your network. There's a variety of sources with details out there, but one starting reference can be found at http://www.marko.net/cheops/
  • I love the idea of Nullable<T> as a null semantic for value types, however unless there is a compiler change I do not see the likelyhood of Nullable<T> being supported by the "as" keyword in c#.

    Ideally, I should be able to use 'as' with Nullable<T> in the same way I would use it with a reference type.

    e.g.
    [c#]
    object i = 1;
    Nullable<int> j = i as Nullable<int>;
    [/c#]

    I had at one time heard that c# might also support Nullable<T> via a shortcut using the ? symbol, as in:

    [c#]
    ?int i = null;
    if(i.HasValue)
    {
    ...
    }
    [/c#]

    Is this still happening? And if so is there the possiblity of providing 'as' support?
  • appologize for the mistake, it was "int?" and I see that it's there.
  • Since Nullable<T> is a struct, does this mean we avoid boxing?
  • Since this is going in to ECMA, dust off your spelling checker. I found two typos just glancing through it (and others that Word green-underlined). Look for "underling" (instead of "underlying") and "Bt" (instead of "But").
Page 1 of 1 (8 items)