I was traveling a bunch over the last two weeks, USA, Japan and Korea. In Osaka, I did a session on Generics for the Japan Developer Camp.
Afterwards, I was having a further play with Highlander and Generics and stumbled across something rather nice. Maybe everyone else is aware of this already, but the new Generics support in Delphi for .NET also gives us access to Nullable types. So the following code:
var
MyInt : Nullable<Integer>;begin
Listbox1.Items.Add(MyInt.HasValue.ToString);
MyInt := 18;
Listbox1.Items.Add(MyInt.HasValue.ToString);
Listbox1.Items.Add(MyInt.Value.ToString);end;
produces the following output in the Listbox:
false
true
18
I’m currently reading through Professional .NET 2.0 Generics to get a better understanding of all the possibilities, but already I’m getting excited by what this allows. I’ll post more as I explore further.
Now, all we need do is to deliver Tiburon to give me Generics in Win32, and I’ll be a happy boy.
Update : Hallvard has written up a good overview of generics in Highlander here
Be the first to leave a comment. Don’t be shy.