<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/11/22 deadalnix <span dir="ltr"><<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Why do we make the distinction between a first class function and a function in the first place ?<br></blockquote><div> </div></div></div><div class="gmail_extra"><div class="gmail_extra">(This is just my recognition, so might be not same with true history. But I think there's not so big mistake.)<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">Historically, mixing function themselves and function addresses had introduced huge confusion for non-expert C programers.</div><div class="gmail_extra">Not to repeat the mistake, D completely distinguished the two at the syntax level - func and &func.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Fortunately it has introduced a good feature in D - when we use the name 'func' without & operator, it could be interpreted as a parenthesis-less function call without ambiguity.</div>
<div class="gmail_extra">In D1, the feature was widely used.</div><div class="gmail_extra"><br></div><div class="gmail_extra">However, the feature has a corner-case issue. If func returns a callable object, function pointer or delegate,</div>
<div class="gmail_extra">does 'func()' mean either "call of 'func'" or "call the callable object which returned by calling 'func'"?</div><div class="gmail_extra">That was particularly important problem for the Range.front API design in D2.</div>
<div class="gmail_extra">To fix the issue, @property attribute has been introduced.</div><div class="gmail_extra"><br></div><div class="gmail_extra">At least to me, your argument is just to return to the C era. I think it will introduce huge 'regression'.</div>
<div><br></div><div>Kenji Hara</div></div></div>