<div dir="ltr"><div>Hi,<br><br></div><div>Thank you for the answers!<br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span class=""><p>
> The FPC wiki states that the ppu file stores all the tokens for the
generic classes. Browsing the source of compiler/symdef.pas (r31298)
also gave me this impression. Does it mean that a recompilation occurs
for every specialization?</p>
</span><p>Not for every specialization. If a specialization for the same
generic with the same types already exists that one will be used. This
also works across units.</p></blockquote>Great, then my third question is not important.<br></div><div><br></div><span class="">
</span><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span class=""></span>> There have been some ideas (again, regarding the wiki) to store the
parse tree instead of the source code (or tokens) in the ppu. I guess
that would made the specializations quicker. What were the reasons
against it?<span class="">
</span><p>Ease of implementation/maintainability. <br>
For the node tree approach the tree would need to be walked and all
accesses to variables of the generic parameter types would need to be
adjusted. This would need adjustments if new node types are added or
node types are extended. However for the token stream approach all this
is handled by existing parser code, so once the parser supports
something it's immediately supported by generics as well (corner cases
of respecting generic types aside).</p></blockquote><div> I see your point, thanks.<br></div><div><br></div><div>Best,<br></div><div>Mátyás<br></div></div>