Adriaan van Os wrote:
Ironically, I have extensive experience with BP objects, but not (much) with objects in Think/MPW/CodeWarrior Pascal on the Macintosh (the reason being my thorough dislike of the object reference model). However, I have access to both GPC, BP and a Macintosh, so, if nobody has the requested information ready, I can do some research (but it would take some time).
I'd rather wait than hurry things and choose a way that will lead to trouble in the future.
In Mac Pascal, each method name must be unique within any object (including inherited objects, recursively). A super-object may override an existing method in an (recursively) inherited object (ie, define a method with an already existing name) , if the new definition exactly matches the old definitions prototype, and the keyword "override" is specified. Otherwise, yes it is an error.
BTW, does MP have `virtual'? Otherwise we should disable this keyword in `--mac-pascal', shouldn't we?
A quick look in the CodeWarrior Pascal Language Reference learns that CW also has the 'inherited" keyword. The GPC manual reads that "Âinherited is an Object Pascal and a Borland Pascal extension".
BTW, I think these reference entries haven't been updated for Mac Pascal (when Peter added the support in the compiler). If someone likes to do it, just send me a diff of reference.texi (it's basically boring work to insert "traditional Mac Pascal" here and there; you can look at predef.h to make sure your entries match the compiler's idea of Mac Pascal).
However, I can't find it in the Turbo Pascal 6.0 Programmer's Guide, nor can I remember it from my BP days (which is more than a decade ago).
BP 7.0 has `inherited' (not sure about 6.0). It can be used only within method definitions of derived object types, and `inherited Foo' means `Bar.Foo' where `Bar' is the parent of the current method's object type.
Assuming it means the same in CodeWarrior Pascal, I'll keep it in `--mac-pascal'.
Frank