<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-01-23 15:19 GMT+01:00 Jacob Carlborg via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:<br><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">This is mostly to prevent ugly hacks like Flag [1].<br>
<br>
<a href="http://wiki.dlang.org/DIP88" rel="noreferrer" target="_blank">http://wiki.dlang.org/DIP88</a><br>
<br>
[1] <a href="https://dlang.org/phobos/std_typecons.html#.Flag" rel="noreferrer" target="_blank">https://dlang.org/phobos/std_typecons.html#.Flag</a><span class=""><font color="#888888"><br>
<br>
-- <br>
/Jacob Carlborg<br>
</font></span></blockquote></div><br><br></div><div class="gmail_extra">About the rationale:<br>> Supporting named parameters directly in the language prevents the need to add workarounds with weird looking syntax like Flag<span style="color:rgb(37,37,37);font-family:sans-serif;font-size:14px;line-height:22.4px"><br></span><br>That's going the opposite way of the current trend, which is shift as much feature to library as possible.<span style="color:rgb(37,37,37);font-family:sans-serif;font-size:14px;line-height:22.4px"><br></span></div><br>> When interfacing with Objective-C it might be desirable to have a method calling syntax which resembles the syntax used in Objective-C and Swift.<br><br>Implementing cosmetic features from a language because it appeals to its user doesn't sound that useful to me.<br><br>The `createReq` example is a bit artificial, as you would usually replace it with a struct.<br><br>About the design:<br>As mentioned earlier, forcing users to say which arguments can be named and which cannot seems like an unnecessary limit. We'll just end up with everyone using ':' after parameter names (which is very weird looking IMO) in order to be able to use that syntax at the call site, if necessary. Also, bear in mind that a lot of code one will use is not under one's direct control. So if we want to use named parameter with a framework which doesn't define this syntax, you cannot.<br>Since changing the order of parameter is not allowed, it sounds better to just allow this syntax at the call site.<br>Also, one point which was not covered, should the compiler enforce that the name used matches ? E.g. if I use `heigh` instead of `height`, should the compiler tell me "change name `heigh` to `height`" ?<br><br>Overall, I'm not found of it. It looks like a lot of complication for little to no benefit.</div>