<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 08/07/2018 16:50, J. Gareth Moreton
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:4540.1531061403@web-cluster.fastnet.co.uk">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>Hi
everyone,<br>
<br>
<div>With some blessing from Florian on the concept, I've set up a
Wiki page discussing the design proposals for the support of
pure functions, as well as some explanation on what they
actually are.</div>
<div><br>
</div>
<div>wiki.freepascal.org/Pure_functions</div>
<div><br>
</div>
<div>I hope it proves useful to explain what I'm doing. How do the
proposals look so far, Florian?<br>
</div>
</blockquote>
<br>
I seem to be missing a part of the feature (or did I misunderstand
(part of) the side?<br>
<br>
It is all about the compiler evaluating pure functions at compile
time, and placing the result as a constant in the code. (Or at least
that's how I read it).<br>
That's all fine.<br>
<br>
But what about re-using results at runtime.<br>
<br>
b := sin(x);<br>
If x is unknown this can not be computed at compile time.<br>
But<br>
if sin(x) > y then b := sin(x);<br>
<br>
Knowing that sin is pure AND knowing that x did not change, means
only one call is needed.<br>
Is that also planed?<br>
<br>
</body>
</html>