<div dir="ltr"><div>excuse me....but I'm no sure ...is it true pas2js already has anonymous method support ? <br></div><div><br></div><div>Thank a lot!</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 21 oct. 2019 a las 22:22, warleyalex via Pas2js (<<a href="mailto:pas2js@lists.freepascal.org">pas2js@lists.freepascal.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">generic function Min<T>(const A, B: T): T;<br>
begin<br>
if A < B then<br>
Result := A else<br>
Result := B;<br>
end;<br>
<br>
begin<br>
// it compiles/worked as expected<br>
specialize Min<Integer>(1, 0); // Min (1, 0): 0<br>
specialize Min<Single>(3.14, 5); //Min (3.14, 5): 3.14<br>
specialize Min<string>('a', 'b'); //Min ("a", "b"): a<br>
<br>
(* but we can not compile the following: *) <br>
<br>
WriteLn('Min (1, 0): ', specialize Min<Integer>(1, 0));<br>
WriteLn('Min (3.14, 5): ', specialize Min<Single>(3.14, 5));<br>
WriteLn('Min (''a'', ''b''): ', specialize Min<string>('a', 'b'));<br>
end;<br>
<br>
projGenericsA.lpr(29,41) Error: not yet implemented:<br>
TInlineSpecializeExpr:TInlineSpecializeExpr [20170306102158]<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="noreferrer" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br>
_______________________________________________<br>
Pas2js maillist - <a href="mailto:Pas2js@lists.freepascal.org" target="_blank">Pas2js@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><pre style="color:rgb(0,0,0);font-variant:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px">MSc. Ing. Pedro Pablo Oviedo Vera
Dirección Técnica y Desarrollo
Empresa de Proyectos e Ingeniería del
Ministerio de la Agricultura.ENPA.
Boyeros y Conill, Piso 10 Edif MINAG
Telef. 884 7197
SIP:23000116</pre></div></div>