<div dir="ltr"><div><div><div>Hi Sven,<br><br></div>Not to "debate" the syntax, but just ask :-)<br><br></div>1) in my second example: proc_ints: specialize ProcessArray<LongInt>; it is "specialized". Why this is still not consistent ?<br>
<br></div>2) in delphi mode, "specialize" is not required anywhere, right? If so, can you write an example of your new proposal in delphi mode? btw, my last experience with Delphi is 6 or 7, there was no generics yet.<br>
<br>Thanks<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/4 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Am 04.09.2013 09:13, schrieb Xiangrong
Fang:<br>
</div><div class="im">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>Thanks. This is sort-of too verbose when use. I have
no comments about how to define it, but when use it, can we
just use:<br>
<br>
</div>
ProcessArray(someintarray); ?<br>
</div>
</div>
</blockquote></div>
No. Generics are specialized with "<SomeType>", so not using
it for procedures/functions/methods as well is inconsistent.<div class="im"><br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
<br>
</div>
<div>The complier should be able to "specialize" it implicitly
because it knows someintarray is array of integer?<br>
<br>
</div>
<div>alternatively, how about this:<br>
<br>
</div>
<div><span style="font-family:courier new,monospace">var<br>
</span></div>
<div><span style="font-family:courier new,monospace">
proc_ints: specialize ProcessArray<LongInt>;<br>
</span></div>
<div><span style="font-family:courier new,monospace">begin<br>
</span></div>
<div><span style="font-family:courier new,monospace">
proc_ints(someintarray);<br>
</span></div>
<div><span style="font-family:courier new,monospace">end;</span><br>
</div>
<div><br>
</div>
<div>use it without explicit specialize is best, however.<br>
</div>
</div>
</blockquote></div>
No. In non-Delphi modes specializations require "specialize". This
is for consistency of the language and also for simplification of
the parser in those modes.<br>
<br>
And just in case: The syntax is not up to debate.<br>
<br>
Regards,<br>
Sven<br>
</div>
<br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div>