<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 17, 2016, at 19:18 , 肇鑫 via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:georgia,serif">Hi David,</div><div class="gmail_default" style="font-family:georgia,serif"><br class=""></div><div class="gmail_default" style="font-family:georgia,serif">You understanding is correct. </div><div class="gmail_default" style="font-family:georgia,serif"><br class=""></div><div class="gmail_default" style="font-family:georgia,serif">There is only one thing I have to mention. Unless the other c style languages which you can call default values in the middle, Swift only allows you to call default values in the last. That makes you example:</div><div class="gmail_default" style="font-family:georgia,serif"><br class=""></div><div class="gmail_default"><font face="georgia, serif" class="">func print(message: String = default, path: String = default, line: Int = default)</font><br class=""></div><div class="gmail_default"><font face="georgia, serif" class=""><br class=""></font></div><div class="gmail_default"><font face="georgia, serif" class="">can only wrapped to 4 functions instead of 8.</font></div><div class="gmail_default"><font face="georgia, serif" class=""><br class=""></font></div><div class="gmail_default"><span style="font-family:georgia,serif" class="">func print(message: String, path: String, line: Int)</span><font face="georgia, serif" class=""><br class=""></font></div><div class="gmail_default"><span style="font-family:georgia,serif" class="">func print()</span><span style="font-family:georgia,serif" class=""><br class=""></span></div><div class="gmail_default"><span style="font-family:georgia,serif" class="">func print(message: String)</span><span style="font-family:georgia,serif" class=""><br class=""></span></div><div class="gmail_default"><span style="font-family:georgia,serif" class="">func print(message: String, path: String)</span><span style="font-family:georgia,serif" class=""><br class=""></span></div><div class="gmail_default"><span style="font-family:georgia,serif" class=""><br class=""></span></div><div class="gmail_default"><font face="georgia, serif" class="">You can't call func print(path: String) by calling </font><span style="font-family:georgia,serif" class="">func print(message: String = default, path: String = default, line: Int = default)</span><span style="font-family:georgia,serif" class="">. print(_, path: "path"t, line: _) is not a valid calling in Swift.</span></div></div></div></blockquote><br class=""></div><div>This is not true.</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>func test(a a: Int = 0, b: Int = 1, c: Int = 2, d: Int = 3) {</div><div> print("\(a) \(b) \(c) \(d)")</div><div>}</div><div>test()</div><div>test(a: 10)</div><div>test(b: 10)</div><div>test(c: 10)</div><div>test(d: 10)</div><div>test(b: 20, a: 10)</div><div>test(a: 10, b: 20, c: 30)</div><div>test(a: 10, d: 20)</div></blockquote><div class=""><br class=""></div>All of these calls are legal.<div class=""><br class=""></div><div class="">Jordan<br class=""><br class=""></div></body></html>