Actually I think I will stick to the global inside types solution, and just put myself the "g_List = New TList" statement right before the type declaration (like I'd like BlitzMax to do for me behind the scenes).
And *certainly* not that bad considering that we can't hide g_List from the outside anyway, due to the lack of support for Private/Public inside types (might be another feature request..), so we'll always be able to initialize type globals from the main program. I must say I had missed this fact, how accostumed to hiding class members I am (in other languages).
But please Mark, take a moment anyway to consider adding this one day. Put that in your bag of minor but nice improvments.
Or drop a post if there is is some killer problem for doing it.
MyType.g_List = New TList Type MyType Global g_List:TList Method New() g_List.AddLast(Self) End Method Method Delete() g_List.Remove(Self) End Method End TypeWhich is already infinitely better than checking inside the MyType instances if the list is null or not.
And *certainly* not that bad considering that we can't hide g_List from the outside anyway, due to the lack of support for Private/Public inside types (might be another feature request..), so we'll always be able to initialize type globals from the main program. I must say I had missed this fact, how accostumed to hiding class members I am (in other languages).
But please Mark, take a moment anyway to consider adding this one day. Put that in your bag of minor but nice improvments.
Or drop a post if there is is some killer problem for doing it.