[fpc-devel] RTTI unit

Paul Ishenin webpirat at mail.ru
Sun Aug 29 17:12:08 CEST 2010


  29.08.2010 21:39, Dimitri Smits wrote:
>> At the present state of fpc compiler it is technically imposible to
>> port
>> delphi rtti unit. To do this you need first to implement the next
>> compiler features:
>>
>> 1. Extended records (methods, class operators)
>> 2. Generics as in delphi
>> 3. Attributes
> 4. scopeable RTTI ($RTTI directive)

I mean that for implementing RTTI unit compatible by interface with 
delphi you need that 3 features I wrote about. Or how you will port for 
example TValue record:

   TValue = record
   private
     function GetIsEmpty: Boolean;
     ...
     procedure Get<T>(out Result: T);
   public
     // Easy in
     class operator Implicit(const Value: string): TValue;
    ...

1. GetIsEmpty - a method in a record.
2. Get<T>(out Result: T) - generics as in delphi
3. class operator Implicit(const Value: string): TValue - delphi class 
operators

I was wrong about Attributes - seems they are not used in the rtti unit 
interface.

Best regards,
Paul Ishenin.



More information about the fpc-devel mailing list