<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; </style>As far as I know, keywords are often used (e.g. "constexpr" in C++). My
reasons are explained in the Wiki topic, but it boils down to compiler
performance. If every function is assumed to be pure, then the compiler
has to check each time if that is actually the case, and with a large
project with many hundreds of functions and thousands of calls, this
will quickly get prohibitively slow. Generally, most functions will not
be pure, especially given the tight restrictions required (for example,
object methods can't be pure because it's impossible to determine the
value of Self at compile-time, although this may be something for future
research if the method only sets internal fields).<br>
<br>
Also, it won't break existing code. For example, this will compile
without any problems (although the word 'virtual' might appear
highlighted):<br>
<br>
<div>function TestClass.Test: Integer; virtual;<br>
</div><div>var<br>
virtual: Integer;<br>
begin</div><div> virtual := x + 1;</div><div> Result := virtual * virtual;<br>
</div><div>end;<br>
</div><br>
<div>Due to the design of the Pascal language, procedure directives can share names with identifiers without problems.</div><div><br>
</div><div>Gareth<br>
</div> <br>
<br>
<span style="font-weight: bold;">On Sun 08/07/18 17:11 , "R0b0t1" r030t1@gmail.com sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">On Sun, Jul 8, 2018 at 9:50 AM, J. Gareth Moreton
<br>
<<a href="javascript:top.opencompose('gareth@moreton-family.com','','','')">gareth@moreton-family.com</a>> wrote:
<br>
<span style="color: rgb(102, 102, 102);">> Hi everyone,
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> With some blessing from Florian on the concept, I've set up a Wiki page
</span><br>
<span style="color: rgb(102, 102, 102);">> discussing the design proposals for the support of pure functions, as well
</span><br>
<span style="color: rgb(102, 102, 102);">> as some explanation on what they actually are.
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> wiki.freepascal.org/Pure_functions
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> I hope it proves useful to explain what I'm doing. How do the proposals look
</span><br>
<span style="color: rgb(102, 102, 102);">> so far, Florian?
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> Gareth aka. Kit
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<br>
This is usually done without a keyword. Why add a keyword?
<br>
<br>
If a keyword must be used, I'd appreciate if they weren't taken from
<br>
the English language. Doing so is liable to make older code that uses
<br>
variables of the reserved word's name incompilable.
<br>
<br>
Cheers,
<br>
R0b0t1
<br>
<br>
<br>
</blockquote></HTML>