<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 20, 2015 at 11:55 AM, Michael Schnell <span dir="ltr"><<a href="mailto:mschnell@lumino.de" target="_blank">mschnell@lumino.de</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">what to to if a function has no parameter and returns a value that is a pointer to a function of exactly this type ?</blockquote></div><br><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">​<span style="font-family:arial,helvetica,sans-serif">The logical thing for the compiler would be to assume that the programmer meant that a reference should be passed​. If the programmer wanted to invoke the function ans pass the result reference they should use empty parentheses aka "the invocation operator":<br><br></span></div><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif">CallFunction(SomeFunction); // passes a reference to </span><span style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">SomeFunction.</span><br>CallFunction(SomeFunction()); </span><span style="font-family:arial,helvetica,sans-serif">// passes the result of the invocation of </span><span style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">SomeFunction.</span></span></div><span style="font-family:arial,helvetica,sans-serif"><br></span><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif">​So no ambiguity, albeit a very subtle semantic difference that can easily produce bugs.​ But IMHO the "@" notation isn't much better either.<br><br></span></div><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif">PS: I tend to always use the "()" notation when invoking functions with no arguments so it will be clear to a future reader that I'm invoking a function and not assigning some variable. Makes a difference with poorly named functions (not starting with a verb):<br><br></span></div><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif">ADate := Date;<br></span><span style="font-family:arial,helvetica,sans-serif">ADate := Date();</span></div><br></div></div>