Pierre Phaneuf wrote:
It's even more trivial: At the moment, I artificially forbid constructors to be virtual. To enable them, I would just have to take out the error message.
To those that were thinking about removing the Init constructor... We'd now need an anscestor...
No, sorry, Init (as used in BP) can't be virtual, because it has different parameters in different classes.
The Load constructor could be virtual, but not in TObject (because not all classes can be loaded from streams). Therefore, IMHO, it should be in an interface ("streamable").
One might think about another virtual constructor, one without any parameters, to be put in TObject, if such a thing makes sense for *every* possible class (constructing a "default" object of the class). Does this seem reasonable, or could there be classes for which such a constructor wouldn't make sense?
as I said, I'm not sure about the IUnknown bit, but I think it can be optional (just declared as an empty interface for compatibility reasons).
Oh, BTW, the IUnknown thing is like TObject, it is a "parent interface"...
But what does IUnknown do actually? If it's only stuff needed by Delphi, it would be an empty interface in gpc. Of course, we could declare this for compatibility, but I don't think native gpc programs must use it.
(And if the point is to have a common ancestor, it would not be of much concern for gpc, either, since we voted (more or less) against a common ancestor object type.)
This "registration number" is a very Windowy thing.
I feared so... :-(
BTW, do you have a way to avoid collision of those numbers for precompiled units that don't have sources available? With something like TV registration, if an registration error comes up during registration, I just register the class by hand with a different number, and my problems are gone!
If the ID will be as big as suggested (64 or 128 bits), it's possible e.g. for each programmer to get a unique ID of, say, 32 bits. Then each programmer can make sure for himself that (s)he doesn't use the same ID starting with these bits more than once.
From David's posting (28 May) I got the impression that there was a
standard to generate such IDs, but even if there's not, I think we could invent some way that lets any programmer get a (most probably) unique ID.