<div dir="ltr">2013/2/9 kenji hara <span dir="ltr"><<a href="mailto:k.hara.pg@gmail.com" target="_blank">k.hara.pg@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="im">2013/2/9 Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span><br></div><div class="gmail_extra"><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>And I _definitely_ wouldn't want to set a precedence for front to be<br></div></blockquote></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


declared as a non-property function. It needs to be consistently called<br>
without parens to work in generic code, and if arrays are able to use front<br>
with parens, then we definitely risk a lot of range-based functions being<br>
written incorrectly due to the fact that far too often, range-based functions<br>
only end up being tested with arrays, and in that case, the parens wouldn't<br>
cause an error like they should. It wouldn't be caught until someone actually<br>
tried it with another type of range (possibly much later). Granted, the writer<br>
of the range-based function should have tested it better, but given that<br>
arrays are by far the most common type of range, I think that it's just asking<br>
for trouble to allow their front or back to be used with parens.<br></blockquote><div><br></div></div><div>Sorry I cannot imagine an actual use case you are considering.</div></div></div></div></blockquote><div><br></div>
<div style>Ah... do you consider this case?</div><div style><br></div><div>import std.array : front;</div><div>int delegate()[] eventHandlers;</div><div>auto result = eventHandlers.front(); // want to _call_ eventHandlers[0]<br>
</div><div style><br></div><div style>Indeed, under the my proposal, typeof(result) becomes `int delegate()`, not `int`.</div><div style><br></div><div style>Hmmmm.....</div><div style><br></div><div style>Kenji Hara</div>
</div></div></div>