At 12:40 AM +0200 25/7/03, Frank Heckenbach wrote:
What else?
E.g., a test program Peter sent me contained `override' which hadn't been mentioned here so far. So please (all who use Mac Pascal) check carefully if there are any more differences because they might influence the implementation.
BTW, about `override': I'm not quite sure I really understand it (also after looking in OOE). Does it do the same as BP/GPC methods without any special directive which happen to override an inherited method? What happens (in MP/OOE) if a method of the same name as an inherited methods is not declared `override', is it just an error? (Or if an `override' method does not actually override?) IOW, is there actually any behaviour (with or without this directive) that doesn't correspond to BP, or is it just different syntax?
Sorry, I didn't realize BP didn't have "override" - it's unfortunately very difficult to know all the differences between the different implementations of objects when you only know one of them - does anyone have more solid experience with both kinds (Adriaan? Gale?).
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?
No, and yes.
BTW, A quick idea for the object pointers: If we allow `Parent' in `type Foo = object (Parent)' to be an object pointer type, it *may* (still doubtful) be useful to make `Foo' a pointer as well. This way the syntactic difference would be limited to the root object types. This would be particularly useful if there's (by convention or requirement) only one root object type (presumable in a standard unit then), so user programs wouldn't see any difference. But I'm not sure if that's useful or rather a kludge ...
This sounds a bit dubious to me.
One possibility would be to use attributes (but I think you don't currently have type attributes, right?). If we did, presumably something like:
type Foo = object ... end; attribute( pointer );
In this case though, it would probably make sense then to behave as you describe (ie, inheriting objects would inherit the pointer attribute).
Anyway, hopefully that clears up that difference between GPC and MP. Ideally someone with more experience in both types of objects can comment further on any differences. I can clarify any issues with MP's objects, but I don't currently have any experience with GPC objects.
Enjoy, Peter.