<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 8, 2018 at 6:47 PM, Thorsten Engler <span dir="ltr"><<a href="mailto:thorsten.engler@gmx.net" target="_blank">thorsten.engler@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-AU" link="blue" vlink="purple"><div class="m_3484498959208481130WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">You are thinking about something like:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">const<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">  x = FunctionCall(42);<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">In which case, yes, the compiler could possibly see that as in implicit “check if that function is pure”.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">But “constant expressions” can also be something like:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">If FunctionCall(42) > 0 then <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">In which case you don’t want the compiler to have to test every single expression in your program to see if it is composed (all the way down) of pure functions.</span></p></div></div></blockquote><div><br></div><div>Maybe a different approach should be taken?</div><div>Determine how much performance impact is made to determine the purity of a function. and then consider adding a new directive and a keyword.</div><div><br></div><div>thanks,<br></div><div>Dmitry</div></div></div></div>