Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Paul Ishenin
Florian Klaempfl wrote: Since we opened the d2010 can of worms anyways, I think all would be accepted. Thanks for accepting Dispatch changes. Here are the next: http://bugs.freepascal.org/view.php?id=14931 http://bugs.freepascal.org/view.php?id=14930 Best regards, Paul Ishenin. ___

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Paul Ishenin
Paul Ishenin wrote: Michael Van Canneyt wrote: Maybe generate partial RTTI for classes not in $M+ ? I think it is already generated since TypeInfo(TObject) returns data but probably not written by the compiler to the vmtTypeInfo offset. Indeed so. Look at attached patch. Best regards, Paul Is

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Michael Van Canneyt
On Wed, 28 Oct 2009, Thaddy wrote: TObject should NEVER -xcuse me for shouting - contain rtti information And we don't propose to do so :) Michael. ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/list

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Thaddy
TObject should NEVER -xcuse me for shouting - contain rtti information ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Paul Ishenin
Michael Van Canneyt wrote: Maybe generate partial RTTI for classes not in $M+ ? I think it is already generated since TypeInfo(TObject) returns data but probably not written by the compiler to the vmtTypeInfo offset. Best regards, Paul Ishenin. ___ f

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Michael Van Canneyt
On Wed, 28 Oct 2009, Paul Ishenin wrote: Paul Ishenin wrote: I am trying to get UnitName from the RTTI but have some problems: ... Few questions now: a) Why TypeInfo(TObject) <> TObject.ClassInfo? b) Why TypeInfo(TPersistent) = TPersistent.ClassInfo? No idea why but it is the same in delphi <

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Paul Ishenin
Paul Ishenin wrote: I am trying to get UnitName from the RTTI but have some problems: ... Few questions now: a) Why TypeInfo(TObject) <> TObject.ClassInfo? b) Why TypeInfo(TPersistent) = TPersistent.ClassInfo? No idea why but it is the same in delphi < d2010. Probably in d2010 it depends on proj

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Sergei Gorelkin
Paul Ishenin пишет: 2. If I am using PTypeInfo(TypeInfo(Self))^.Kind inside a class method I get tkUnknown and UnitName is not avaiable ofcource. Self = TClass, not TObject inside a class method. Obviously, there is no RTTI or whatever for TClass. Sergei _

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Paul Ishenin
Michael Van Canneyt wrote: Few questions now: a) Why TypeInfo(TObject) <> TObject.ClassInfo? b) Why TypeInfo(TPersistent) = TPersistent.ClassInfo? Because TPersistent is compiled in $M+ ? Yes, that's why I gived that TPersistent example here. I can't figure our how TypeInfo(TObject) works i

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-28 Thread Michael Van Canneyt
On Wed, 28 Oct 2009, Paul Ishenin wrote: Michael Van Canneyt wrote: On the other hand, UnitName may come in handy for the Lazarus IDE. And this is the most difficult thing amoung other new methods :) I am trying to get UnitName from the RTTI but have some problems: 1. If I call PTypeInfo

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Paul Ishenin
Michael Van Canneyt wrote: On the other hand, UnitName may come in handy for the Lazarus IDE. And this is the most difficult thing amoung other new methods :) I am trying to get UnitName from the RTTI but have some problems: 1. If I call PTypeInfo(TypeInfo(TObject))^.Kind then I get tkClass

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Graeme Geldenhuys
2009/10/27 Thaddy : > The ToString Javaism is poorly implemented in Delphi. I suggest that objfpc > mode should be based on json or similar standards, which are already > available. Not just rtti writeouts. Based on the documentation available at Embarcadero, TObject.ToString is very simple - it j

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Graeme Geldenhuys
2009/10/27 Michael Van Canneyt : > > I was going to say the same :-) > > Although I think that  TObject.ToString will give a lot of problems > for things like tiOPF... I was going to say the same. ;-) I just clicked on the link Paul posted to see what ToString does and compare it to tiOPF. --

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Flávio Etrusco
(...) > The ToString Javaism is poorly implemented in Delphi. I suggest that objfpc > mode should be based on json or similar standards, which are already > available. Not just rtti writeouts. > It's poorly implemented on Java too, nonetheless... -Flávio __

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Mattias Gärtner
Zitat von Michael Van Canneyt : On Tue, 27 Oct 2009, Florian Klaempfl wrote: Paul Ishenin schrieb: I have compared what d2010 TObject has and found a few differences: 1. Dispatch method is virtual 2. new method: class function UnitName: string; 3. new method: function Equals(Obj: TObject):

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Paul Ishenin
Thaddy wrote: The ToString Javaism is poorly implemented in Delphi. I suggest that objfpc mode should be based on json or similar standards, which are already available. Not just rtti writeouts. TObject can't be one for ObjFpc mode and one for delphi mode. Best regards, Paul Ishenin. _

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Thaddy
Florian Klaempfl wrote: Paul Ishenin schrieb: I have compared what d2010 TObject has and found a few differences: 1. Dispatch method is virtual 2. new method: class function UnitName: string; 3. new method: function Equals(Obj: TObject): Boolean; virtual; 4. new method: function GetHashCode:

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Paul Ishenin
Michael Van Canneyt wrote: I was going to say the same :-) Although I think that TObject.ToString will give a lot of problems for things like tiOPF... actually it adds problems even to the fpc rtl :) since it has toString member in the component stream parser. Best regards, Paul Ishenin. ___

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Michael Van Canneyt
On Tue, 27 Oct 2009, Florian Klaempfl wrote: Paul Ishenin schrieb: I have compared what d2010 TObject has and found a few differences: 1. Dispatch method is virtual 2. new method: class function UnitName: string; 3. new method: function Equals(Obj: TObject): Boolean; virtual; 4. new method:

Re: [fpc-devel] TObject differences between fpc and delphi

2009-10-27 Thread Florian Klaempfl
Paul Ishenin schrieb: > I have compared what d2010 TObject has and found a few differences: > > 1. Dispatch method is virtual > 2. new method: class function UnitName: string; > 3. new method: function Equals(Obj: TObject): Boolean; virtual; > 4. new method: function GetHashCode: Integer; virtual;