<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hi All,</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">
Is the following possible:</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">type</div><div class="gmail_default" style="font-family:courier new,monospace">
TFunc=function(x: Double): Double;</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">procedure apply(f: TFunc; var x: array of Double);</div>
<div class="gmail_default" style="font-family:courier new,monospace">var</div><div class="gmail_default" style="font-family:courier new,monospace"> i: Integer;</div><div class="gmail_default" style="font-family:courier new,monospace">
begin</div><div class="gmail_default" style="font-family:courier new,monospace"> for i := 0 to Length(x) - 1 do x[i] := f(x[i]);</div><div class="gmail_default" style="font-family:courier new,monospace">end;</div><div class="gmail_default" style="font-family:courier new,monospace">
<br></div><div class="gmail_default" style="font-family:courier new,monospace">apply(@sqrt, x); <-- how can I apply() to built-in functions?</div><div class="gmail_default" style="font-family:courier new,monospace"><br>
</div><div class="gmail_default" style="font-family:courier new,monospace">Thanks!</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">
Xiangrong</div></div>