Thanks Andreas, Chief and the others for your explanations. I've copied your message's IDs into the To-Do-List so that I and others can easily find the messages when it's time to implement these fatures.
I've got a few little questions left (for now :-):
Concerning properties: I assume you cannot pass property fields as var parameters, right? (Otherwise, this would greatly complicate the var parameter mechanism, even in programs that don't use properties at all.)
try // code U try to execute except On EMyException do xxxx; // Do special exception handling here On EAnotherException do xxxx; // What you want else raise; // let the standard exception handler do the thing end;
Is there a way to get the exception that was caught into a variable or so? Something like (fantasy syntax):
On Foo : EAnotherException do Something.With (Foo.ErrDevice);
And yes. Delphi's implementation is /great/ even the new referece counted string types make live much easier. They can save more than > 255,
This, of course, is true for GPC's strings, too. :-)
are dynamically allocated and referece-counted.
Dynamical strings are not yet implemented, but are planned, anyway, in GPC (though they don't seem to be exactly the same as in Delphi).
And can for type-conversion easyly typecased with PChar:
Procedure MyProc (xxx: PChar);
var mystring: String;
MyProc (PChar(MyString));
The most recent GPC versions can do this, but without the explicit type cast, like "MyProc (MyString);". The explicit type cast gives a warning, and not the intended result. Should GPC learn such type casts between values of different string types, too? (Peter?) (Since it seems to be necessary for Delphi compatibility, I suppose the answer will be yes.)
- Interfaces (not really necessary but nice)
Yes, we planned interfaces, too. (I know them from Java and from the OOE draft, I suppose they're similar in Delphi, are they?) However, the internals turned out to be quite difficult. So if someone knows about the internals of how Delphi handles interfaces, especially how it builds the VMTs of classes that inherit from/implement multiple interfaces, any information is welcome!
You asked if there is an description of Delphi/OP. I think there is an helpfile available on www.interprise.com (I'll look if I can find it). But I doubt that it is possible to implement it compatible w/o having a look at Delphi itself. But I hope that I could explain some basic things.
This might be useful for a "clean-room reimplementation"...
Frank
According to Frank Heckenbach:
[...] Should GPC learn such type casts between values of different string types, too? (Peter?) (Since it seems to be necessary for Delphi compatibility, I suppose the answer will be yes.)
Exactly. Not with highest priority, but we should do that together with the other Object Pascal / Delphi stuff.
Peter