On 22 Jul 2005 at 4:38, Waldek Hebisch wrote:
I have put a new "cumulative" diff on my GPC web page:
http://www.math.uni.wroc.pl/~hebisch/gpc/delphi14.diff
and
http://www.math.uni.wroc.pl/~hebisch/gpc/dbxout.diff
I have added a new option `--objects-are-references' (off by default, on for Mac Pascal) which choses reference model for objects. To get Mac semantics one has to use `--objects-are-references' and `--methods-always-virtual'.
This is excellent!
Delphi support still is incomplete (most visibly GPC does not know about `TObject')
I think TObject is a matter for the RTS, and so it becomes automatically available to all programs. In Delphi it resides in the System unit and so is protected from modification by end users. Unless GPC will get a unit that all programs will use implicitly, then the RTS seems to be the correct place. The Delphi 2.0 help file has this to say about TObject ....
"Unit System
Description The TObject object type is the ultimate ancestor of every object (and therefore, every component) in Delphi. If you do not specify an ancestor type when you declare new object type, Delphi automatically uses TObject as the ancestor.
TObject declares a number of methods that every object inherits or overrides:
Construction and destruction Every object has a constructor called Create that initializes the object, calling NewInstance to allocate the memory for the instance and InitInstance to fill that memory with zeros. There is also a virtual destructor called Destroy. In addition, there is a method named Free that calls Destroy only if the instance is non- nil. Destroy calls FreeInstance to release the memory allocated by NewInstance. FreeInstance in turn calls CleanupInstance to finalize long strings and other data structures before their memory is deallocated.
Type-information methods The methods ClassInfo, ClassName, ClassNameIs, ClassParent, ClassType, InheritsFrom, and InstanceSize all provide useful information about the object type or its instances. In addition, you can get run-time type information (RTTI) on published parts of an object from the following methods: FieldAddress, MethodAddress, and MethodName.
Message-handling methods Every object also has built-in support for the handling of messages, with the Dispatch and DefaultHandler methods."
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/