<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 8, 2018 at 11:20 AM, J. Gareth Moreton <span dir="ltr"><<a href="mailto:gareth@moreton-family.com" target="_blank">gareth@moreton-family.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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. <br></blockquote><div> </div></div>How about adding a new modeswitch instead PUREFUNCTIONS?</div><div class="gmail_extra">The mode switch would treat any "function" as pure function (and should check the code for "purity").<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">While at the same time would allow "procedures" to return values:<br></div><div class="gmail_extra">procedure Random(l: LongInt):LongInt;<br></div><div class="gmail_extra"><div class="gmail_extra"><br></div><div class="gmail_extra">However, not having an extra modeswitch or new keywords would be beneficial:</div><div class="gmail_extra"><br></div><div class="gmail_extra">From the compiler performance perspective, the purity of a function needs to be checked only when evaluating constant expressions (according to the wiki article)</div><div class="gmail_extra">Thus the actual use of a function in a constant expression should act as the proposed "pure" keyword.<br></div><div class="gmail_extra"><br></div></div><div class="gmail_extra">thanks,</div><div class="gmail_extra">Dmitry</div></div>