Re: [swift-users] WWDC Meetup

2016-06-06 Thread Michael Nisi via swift-users
Great initiative—and a really interesting question: how many Swift Open Source people attend WWDC? > On 06.06.2016, at 08:35, David Hart via swift-users > wrote: > > I imagine that during WWDC a non-negligible proportion of the Swift Open > Source contributors will be in or around San-Francis

Re: [swift-users] Is 12:01:00A.M in DataFormatter.localizedString correct?

2016-08-28 Thread Michael Nisi via swift-users
The 12-hour clock will always remain a mystery to me https://en.wikipedia.org/wiki/12-hour_clock “Likewise, some U.S. style guides recommend either clarifying "midnight" with other context clues, such as specifying the two dates between which it falls, or not referring to midnight at all. For an e

Re: [swift-users] if-case syntax ambiguity

2016-11-09 Thread Michael Nisi via swift-users
Yes, equals isn't assignment but pattern matching here. Reminds of Erlang, which I love. Michael > On 9 Nov 2016, at 12:57, Zhao Xin via swift-users > wrote: > > The `if case` is the same meaning as `switch-case`, so I don't think there is > anything ambitious. For `switch-case`, it is not e

Re: [swift-users] How to merge two dictionaries?

2016-11-11 Thread Michael Nisi via swift-users
For example, you might want to merge values: let d1 = ["Apples": 20, "Oranges": 13] let d2 = ["Oranges": 3, "Cherries": 9] let d3 = [d1, d2].reduce([String : Int]()) { acc, d in var dx = acc for entry in d { let key = entry.key guard dx[key] == nil else { dx[key]! += entr