On 9 Jun 2005 at 11:44, Peter N Lewis wrote:
With the recently announced move by Apple to convert the Mac platform over to Intel processors (at least initially still closed hardware, but with an Intel processor instead of a PowerPC) starting next year and completing the transition in 2007, the need for Pascal users to move from Metrowerks CodeWarrior Pascal to XCode/GPC (or FPC) is now much more immediate.
I presume since GCC can build a fat bundle application for both PPC and x86 that there will not be any problem with GPC doing that too.
So the primary problem that remains is the difference between Mac style objects and Borland style objects which we've discussed before. The primary requirement as I see it is the ability to write code where the use of the objects is source compatible (possibly using Macros if necessary), and the object definition has as few changes as possible, preferably also handled by macros.
As I see it, the minimal changes required are:
- Allow objectptr.field as a synonym for objectptr^.field
(currently this would be an error, so it is a relatively safe allowance)
- Allow type newobject = object(objectptr) ... end;
(currently this would be an error, so it is a relatively safe allowance)
Support the "override" keyword and add a compiler flag to require it.
Add a compiler flag to disable the "virtual" keyword and make all
methods virtual by default.
- Preferably add a compiler flag to say "objects are pointers" which
simply adds an implicit pointer reference to the object type definition, ie:
type myobject = object(superobject) ... end;
implicitly becomes
type myobject = ^object(superobject) ... end;
Without this change, but with the other changes, the user could change the object definition from:
type myobject = object(superobject) ... end;
to
type myobject = ^myrealobject; myrealobject = object(superobject) ... end;
[...]
Most of these changes are implicit in Delphi-style "Classes", which I believe, are on the GPC "to do" list. Once GPC gets the "Class" type, there will be no need to do any of these. So I guess what you are pushing for is a quick implementation of Classes. I am not sure myself that this would be a trivial undertaking. However, I'll leave Frank and Waldek to speak to that point.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/