TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Swift Function Fun Facts

46 点作者 DaNmarner大约 10 年前

4 条评论

gilgoomesh大约 10 年前
There&#x27;s more than a couple situations where Swift forces you to repeat yourself. No default implementations for protocols and missing language features for dealing with enums would probably be more prominent examples than this narrow availability of default arguments problem.<p>I&#x27;m not sure any one of these &quot;work in progress&quot; related issues are a reason to &quot;hate Swift&quot; (or at least, where Swift is going). It&#x27;s more a reason to hate the current status of Swift as a project – since it will probably be a year or two before these sorts of non-critical issues bubble to the top of the Swift development team&#x27;s priority list.
eridius大约 10 年前
This is a very odd post. It basically boils down to default arguments only work on named functions, they don&#x27;t work on function values (whether this is a curried function, or a declared value of function type). Which seems like a perfectly reasonable restriction to me; default argument values are a property of named functions, not of function types, and cannot be expressed in the type system. While it&#x27;s not out of the realm of possibility for Swift to extend the type system to support this, it&#x27;s not something I&#x27;d hold my breath for and it&#x27;s not something I feel that I could rightly criticize Swift for not having. And yet, the author declares &quot;Now, you hate Swift&quot; based on this one perceived limitation.
评论 #9402612 未加载
评论 #9402128 未加载
评论 #9402477 未加载
alexjarvis大约 10 年前
I also ran into this problem a couple of times..<p>It&#x27;s not the only issue. I put it down to how new the language is and how many non-critical issues they can fix.<p>Swift 1.2 has been a massive improvement with incremental compiling and the SourceKit HUD not flickering in my face every few minutes. But still Xcode crashes frequently.<p>With all the known problems considered, I still find that the advantage of using Swift far outweighs the small number of issues with it in its current version.
dilap大约 10 年前
headers are string -&gt; [string]!