I would like to slightly update Mac objects and Delphi classes support. In particular I ma thinking about options names. AFAICS there five major axes which differentiate dialects that we would like to support: 1) Value versus reference model: BP - value model (objects are values) OOE, Delphi, Mac - pointer model (object are pointer to values) 2) Static versus virtual methods: OOE, Mac - mehods are always virtual BP, Delphi - there are static methods 3) Keywords used: BP, Mac - use "object" as a keyword (but with different semantics) OOE, Delphi - use "class" keyword 4) Method redefinition: BP - silent overriding Delphi - silent shadowing, override needs "override" OOE, Mac - explicit "override" needed 5) Base object: BP, Mac - no base object, multiple roots OOE - "Root" is the root of inheritance tree Delphi - "TObject" is the root of inheritance tree There is also question if constructors are mandatory for objects with virtual methods. ATM I think that we may tie this to object model: in value model (BP) make them mandatory, in reference mode make them optional. Namely, Mac objects have no constructors while OOE and Delphi will get them without any explicit declaration. I propose to have the following options: -fobjects-are-references -- choose reference model even if the declaration uses "object" keyword, on for Mac Pascal, off otherwise -fmethods-always-virtual -- leave it as is -fobjects-require-override -- to require "override" even for objects declared using "object" keyword (classes will always require "override") -fdelphi-method-shadowing -- redefinition without override will shadow (hide) old definition. By default to hide old definition one would have to use OOE "view" or Delphi "reintroduce" directive -fbase-object= -- to add default parent to object without an explicit parent the last option will require some effort to implement. Additionally, we may have -fmac-objects directive, which would be equivalent to sum of -fobjects-require-override, -fmethods-always-virtual and -fobjects-are-references. Comments? -- Waldek Hebisch hebisch@math.uni.wroc.pl
participants (6)
-
Adriaan van Os -
Frank Heckenbach -
Markus Gerwinski -
Prof A Olowofoyeku (The African Chief) -
Thorsten Glaser -
Waldek Hebisch