[fpc-devel] RTTI unit

Dimitri Smits smitco at telenet.be
Sun Aug 29 15:39:02 CEST 2010

Hi Paul,
thanks for the input.

----- "Paul Ishenin" <webpirat at mail.ru> schreef:

> 29.08.2010 3:46, Dimitri Smits wrote:
>> What I want to do:
>> Since Delphi 2010, there is a new unit in the RTL that makes RTTI
>> more of a breeze. I'd like to port (meaning: compatible interface, fpc
>> implementation) this unit to fpc-rtl. Initially port over what is
>> there already. Later maybe include in the compiler stuff like scoped
>> RTTI (not just published alone) and "customattributes" if there is
>> need for that level of compatibility. Also, adding more methods on the
>> current interface is possible too. It is more than just a readable
>> substitute for TypInfo.

> 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)

> Once I tried to implement extended records in the compiler but the 
> changes were too big for the time I had and I had left that idea for
> the 
> better time.

incremental changes. First try the basic types, then classes/objects/records. And leave out those types for now that cannot be ported. In a next phase, then include what is needed either in compiler or fpc-specific rtti objects (in same style/spirit).

As for that (4) above. The last few months I've seen this requested a few times (either direct or indirect) on mailinglists.

kind regards,
Dimitri Smits

More information about the fpc-devel mailing list