[fpc-devel] Records nesting/inheritance?

Чернов Дмитрий blackdoomer at yandex.ru
Wed Aug 5 09:13:27 CEST 2015



05.08.2015, 16:20, "Michael Van Canneyt" <michael at freepascal.org>:
> On Wed, 5 Aug 2015, Чернов Дмитрий wrote:
>
>>  Good day everyone.
>>
>>  Recently I've tried to write some social network parsing code and faced with numerous nesting of structures (records).
>>  When I completely tired to write things like Friend.BaseUser.City.ID ("real programmer will never get complerely tired", hah - yes, I know), I thought out that it might be cool to have such a
>>  feature as structures inheritance.
>>  I'm not very good in English, so, instead of describing everything I'll just try to write an example:
>>
>>  http://pastebin.com/Pm701Nh4
>>
>>  So, there's examples of addressing some fields with and without this feature:
>>  Friend.BaseUser.FirstName  >> Friend.FirstName
>>  Friend.UserInfo.Country.ID >> Friend.Country.ID
>
> You can do this already with extended records, just declare properties.
>
> http://www.freepascal.org/docs-html/ref/refse51.html#x107-1170009.1
>
> Michael.
> ,
>
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



More information about the fpc-devel mailing list