TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Swift Function Fun Facts

46 pointsby DaNmarnerabout 10 years ago

4 comments

gilgoomeshabout 10 years ago
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.
eridiusabout 10 years ago
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 未加载
alexjarvisabout 10 years ago
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.
dilapabout 10 years ago
headers are string -&gt; [string]!