On Tue, Jan 19, 2010 at 18:35, Aleksa Todorovic <alexi...@gmail.com> wrote: > On Mon, Jan 18, 2010 at 04:07, Aleksa Todorovic <alexi...@gmail.com> wrote: > > One (not very nice) way to have generic list of records is using > macros. I've extracted definition of TFPGList, made it ordinary type, > and did some search/replace, so I get: > > [SNIP] >
Just to report how I managed to (ab)use FPC and Lazarus to have both generics of records and full code-completition (note I turned C-style macros on for the whole project): in interface: TMessageParameter = record ... end; TMessageParameters = TList; // this makes Lazarus code completition actually work; maybe better to use TFPSList operator = (const A, B: TMessageParameter): Boolean; {$DEFINE _TFPGList_Type_ := TMessageParametersFPGList} {$DEFINE _TFPGList_ItemType_ := TMessageParameter} {$INCLUDE fpglist_h.inc} // copied and adapted interface from FGL {$DEFINE TMessageParameters := TMessageParametersFPGList} // last line is used to make it all actually work in implementation: operator = (const A, B: TMessageParameter): Boolean; begin Result := ...; end; {$DEFINE _TFPGList_Type_ := TMessageParametersFPGList} {$DEFINE _TFPGList_ItemType_ := TMessageParameter} {$INCLUDE fpglist.inc} // copied and adapted implementation from FGL _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal