Gale Paeper wrote:
The other part of OOE's deferred class requirement (i.e., "cannot be used in a class-inheritance-list before its complete definition is specified") is also enforced. A slight modification of the test program I've been using for an example:
OK, thanks.
For the sake of completeness and since the error message refers to external object declarations, I suppose CodeWarrior Pascal and MPW Pascal's support for external object declarations should be mentioned.
The basic purpose and reason for external object declaration is the same as it is for forward declared objects except it is used for mutually dependent object type declarations between unit interfaces.
Before an example program demonstrating the external object feature and how it can be used, a few notes on this particular MacPascal Object Pascal feature:
- I'm not sure any real world program actually makes use of it.
I'm glad to hear so. I guess I never understand why someone would want to do this. If two objects are mutually dependent, they obviously form one, not two, "units" in the normal meaning of the word. Well, perhaps it's a relic of 64KB times where size restrictions dictated such a split ...
- Even Apple, who invented the feature for MPW Pascal, called code
using external objects "ugly" and the code, even though it maybe useful, confusing.
:-)
- It isn't the easiest feature to make use of. It takes some thought
and care in organizing code to avoid circular unit interface dependency errors and unresolved external object declaration errors.
So, there's no misunderstanding, I'm not asking for GPC's support for MacPascal style objects to include external object declaration support. Put it in the "to be considered if someone really needs it" bin. I'm covering MacPascal external object declaration support so that Frank and Waldek are at least aware of the feature and have an example of its usage.
OK.
Frank