<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>It's sort of the other way around. The lack of the directive implies the function is impure, and so the compiler won't bother with any kind of purity check. The presence of "pure" slows down the compiler, but possibly producing much more efficient code. Because pure functions will be rare, it seems only right to mark the functions that definitely fulfil the criteria (or so the programmer thinks), rather letting the compiler attempt to find the pure functions itself, when upwards of 99% of them will be impure.<br>
<div><br>
</div><div>It also simplifies things for the programmer as far as constant assignment is concerned, otherwise it might appear random and arbitrary in that some functions can be assigned to constants, but not others, while throwing a warning if a function is marked pure but actually isn't helps to inform the programmer that they might have made a mistake.<br>
</div> <div><br>
</div><div>Gareth<br>
</div><br>
<span style="font-weight: bold;">On Sun 08/07/18 18:33 , marcov@stack.nl (Marco van de Voort) sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">In our previous episode, Florian Kl?mpfl said:
<br>
<span style="color: rgb(102, 102, 102);">> >
</span><br>
<span style="color: rgb(102, 102, 102);">> > It doesn't explain why you chose for a modifier rather than preprocessor
</span><br>
<span style="color: rgb(102, 102, 102);">> > switch.
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> Why a preprocessor switch for something which applies to a particular function?
</span><br>
<br>
Maybe. But this kind of stuff will be rare, and is only an hint to speed up
<br>
parsing. I think having a directive is a bit too much honor.
<br>
<br>
Maybe it is time for an attribute system?
<br>
_______________________________________________
<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a target="_blank" href="<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>"><span style="color: red;">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</span></a>
<br>
<br>
<br>
</blockquote></HTML>