<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 04.09.2013 08:18, schrieb Xiangrong
Fang:<br>
</div>
<blockquote
cite="mid:CAP93jB2pT_o3D-KVG52AB8CJD7+HpRx2BOr=+L93NdGOkfDxKw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi There,<br>
<br>
</div>
I try to write a procedure with generic parameters, but
failed:<br>
<span style="font-family:courier new,monospace"><br>
</span></div>
<span style="font-family:courier new,monospace">type<br>
</span></div>
<span style="font-family:courier new,monospace"> generic
TArray<T> = array of T;<br>
<br>
</span></div>
<span style="font-family:courier new,monospace">procedure
ProcessArray(arr: TArray<T>);<br>
begin<br>
end;</span><br>
<br>
<br>
</div>
<div>The compiler said "Generics without specialization cannot
be used..."<br>
<br>
</div>
<div>But if I specialize the parameter then this procedure is
useless.<br>
<br>
</div>
<div>Any ideas?<br>
<br>
</div>
</div>
</blockquote>
This is not yet supported. A proof of concept implementation exists
locally on my computer however. It will then look like this:<br>
<br>
=== code begin ===<br>
<br>
type<br>
generic TArray<T> = array of T;<br>
<br>
generic procedure ProcessArray<T>(arr: TArray<T>);<br>
begin<br>
end;<br>
<br>
begin<br>
// usage:<br>
specialize ProcessArray<LongInt>(someintarray);<br>
end.<br>
<br>
=== code end ===<br>
<br>
Regards,<br>
Sven<br>
</body>
</html>