Partilhar via


Specification for Nullable [Kit George]

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 https://www.gotdotnet.com/team/clr/bcl/general/nullable2.doc. We'll continue to make more specifications available as we get closer to shipping!

Comments

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

    Think of it as advance documentation for the type ;-)
  • Anonymous
    October 15, 2004
    The comment has been removed
  • Anonymous
    October 16, 2004
    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?
  • Anonymous
    October 16, 2004
    appologize for the mistake, it was "int?" and I see that it's there.
  • Anonymous
    October 17, 2004
    Since Nullable<T> is a struct, does this mean we avoid boxing?
  • Anonymous
    November 05, 2004
    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").