Re: [swift-users] for with optional collection?

2017-02-09 Thread David Hart via swift-users
someOptionalCollection?.forEach { item in } > On 9 Feb 2017, at 22:48, Marco S Hyman via swift-users > wrote: > > >> On Feb 9, 2017, at 1:26 PM, Rick Mann via swift-users >> wrote: >> >> Is there any concise way to write the following? >> >> if let collection = someOptionalCollection >> {

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-users
> On Feb 9, 2017, at 4:09 PM, Matthew Johnson wrote: > > >> On Feb 9, 2017, at 6:04 PM, Ted Kremenek > > wrote: >> >> >>> On Feb 9, 2017, at 3:52 PM, Ted Kremenek via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> I’ve been mostly silent in this co

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Matthew Johnson via swift-users
> On Feb 9, 2017, at 6:04 PM, Ted Kremenek wrote: > > >> On Feb 9, 2017, at 3:52 PM, Ted Kremenek via swift-users >> mailto:swift-users@swift.org>> wrote: >> >>> I’ve been mostly silent in this conversation largely because I didn’t >>> realize it was leading up to a formal decision. I wish

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-users
> On Feb 9, 2017, at 3:52 PM, Ted Kremenek via swift-users > wrote: > >> I’ve been mostly silent in this conversation largely because I didn’t >> realize it was leading up to a formal decision. I wish it would have >> followed the proposal process so it was clear to everyone that a decision

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Ted Kremenek via swift-users
> On Feb 9, 2017, at 9:30 AM, Matthew Johnson via swift-evolution > wrote: > > >> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> >>> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users >>> mailto:swift-users@swift.org>> wrote: >

[swift-users] So how do you implement a NSTextStorage subclass in Swift?

2017-02-09 Thread Michel Fortin via swift-users
The `string` property of `NSTextStorage` is of type `String`, but the contract it must implement is that it should return the backing store of the attributed string (the underlying `NSMutableString` used as the backing store). It seems to me that this makes it impossible to implement correctly a

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Joshua Alvarado via swift-users
The decision to move from the mailing list may have surprised many but the discussion on it has been ongoing very strong. Sorry you feel like you didn't get to voice your opinion which I believe everyone should have the opportunity to. I think many agree that email has it's perks on iPhone and iPad

Re: [swift-users] for with optional collection?

2017-02-09 Thread Rick Mann via swift-users
> On Feb 9, 2017, at 13:31 , Saagar Jha wrote: > > for item in someOptionalCollection ?? [] { > item.doSomething() > } > Thanks, this is probably the closest. Sadly I can't seem to test downcasting because Playgrounds just stop working, with no feedback, for this code: class Foo {

Re: [swift-users] for with optional collection?

2017-02-09 Thread Marco S Hyman via swift-users
> On Feb 9, 2017, at 1:26 PM, Rick Mann via swift-users > wrote: > > Is there any concise way to write the following? > > if let collection = someOptionalCollection > { >for item in collection >{ >} > } someOptionalCollection?.map { /* do something with $0 /* } _

Re: [swift-users] for with optional collection?

2017-02-09 Thread Saagar Jha via swift-users
Or even for item in someOptionalCollection ?? [] { item.doSomething() } Saagar Jha > On Feb 9, 2017, at 1:30 PM, Jeff Kelley via swift-users > wrote: > > You can do something like this: > > someOptionalCollection?.forEach { item in > item.doSomething() > } > > Or this: > > (s

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread David Young via swift-users
On Wed, Feb 08, 2017 at 04:03:39PM -0800, Ted kremenek via swift-users wrote: > Hi everyone, > > There was a long thread on swift-evolution about whether we should use modern > forum software — like Discourse — as an alternative to the mailing lists we > have now. After a long discussion, the C

Re: [swift-users] for with optional collection?

2017-02-09 Thread Jeff Kelley via swift-users
You can do something like this: someOptionalCollection?.forEach { item in item.doSomething() } Or this: (someOptionalCollection as? [SomeType])?.forEach { item in item.doSomething() } Jeff Kelley slauncha...@gmail.com | @SlaunchaMan | jeffkell

[swift-users] for with optional collection?

2017-02-09 Thread Rick Mann via swift-users
Is there any concise way to write the following? if let collection = someOptionalCollection { for item in collection { } } I can imagine more complicated things, too: if let collection = someOptionalCollection as? [SomeType] { for item in collection { } } It would be nic

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Cihat Gündüz via swift-users
@Jan: Your arguments are very subjective if not even insulting and derogatory to many people who invest a lot of time and effort in crafting those things you despise so openly. Here are just a few example quotes for you to reflect your language: "I despise fp“, „is so annoying“, "made Swift imo

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Joshua Alvarado via swift-users
🎉🎊🎉🎊🎉🎊🎊 This is an awesome decision and a huge enhancement for the Swift community. Thanks (Core Team) for taking the time to entertain the discussion and move forward with what many community members have wanted. Alvarado, Joshua > On Feb 8, 2017, at 5:03 PM, Ted kremenek via swift-evolution

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread André Videla via swift-users
Lots of emotions here. There is something I would like to point out that I don't feel is clear enough. The goal of this move is to move the community forward. The way it is moving the community forward is by increasing the scope of people able to participate while allowing new capabilities for

Re: [swift-users] Swift kernel for Jupyter Notebook/IPython

2017-02-09 Thread David Young via swift-users
On Wed, Feb 08, 2017 at 12:39:34PM +, Jin Wang via swift-users wrote: > Hey guys, > > I'm building a swift kernel for Jupyter Notebook. If you haven't heard of > it, *the Jupyter Notebook is a web application that allows you to create > and share documents that contain live code, equations, vi

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
Easy explained - The problem rises indeed not from the added features but from the fp group that imposes it’s usage in the Standard libraries and “the swifty way”. I like many features of Swift (or I wouldn’t be here) but I don’t want to live in Haskel world. And for some reason these guys becom

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread David Sweeris via swift-users
> On Feb 9, 2017, at 09:30, Matthew Johnson via swift-users > wrote: > > >>> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users >>> wrote: >>> >>> >>> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users >>> wrote: >>> >>> I would prefer http://www.fudforum.org/ that has good

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Michael Sheaver via swift-users
I have a simple question along this line: How does expanding the capabilities of Swift detract or impair its use in a fully OO manner? From what I have seen, if you want to use it in a strictly OO manner, great! If you want to use it in a strictly functional manner, no problem. If you want to us

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Andreas Mayer via swift-users
> Am 09.02.2017 um 01:03 schrieb Ted kremenek via swift-users > : > > After a long discussion, the Core Team has decided to move swift-evolution > and swift-users to Discourse. Are you hosting your own Discourse server? (Is that even possible?) Because I block discourse.com globally. Also, I

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
This is just for explanation. I have given up for the content, the world does move in this direction and I can’t stop it. > On 9 Feb 2017, at 18:29, Cihat Gündüz wrote: > > @Jan: Your arguments are very subjective if not even insulting and derogatory > to many people who invest a lot of time a

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Rien via swift-users
> On 09 Feb 2017, at 18:29, Cihat Gündüz via swift-evolution > wrote: > > @Jan: Your arguments are very subjective if not even insulting and derogatory > to many people who invest a lot of time and effort in crafting those things > you despise so openly. Here are just a few example quotes for

Re: [swift-users] Problem with console apps

2017-02-09 Thread Jens Alfke via swift-users
> On Feb 9, 2017, at 3:33 AM, Andrey Fidrya via swift-users > wrote: > > Neither setbuf(stdout, nil) nor fflush(stdout) helps, so it appears > this is an Xcode issue. In that case you should file bug report at http://bugreport.apple.com . The xcode-users mailing

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Matthew Johnson via swift-users
> On Feb 9, 2017, at 11:16 AM, Jens Alfke via swift-users > wrote: > > >> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> I would prefer http://www.fudforum.org/ that has >> good mailing list support, too. >

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jens Alfke via swift-users
> On Feb 9, 2017, at 3:41 AM, Jan Neumüller via swift-users > wrote: > > I would prefer http://www.fudforum.org/ that has > good mailing list support, too. Well, we appear to have completely opposite opinions on UI/usability. I took a look at fudforum and yeah, to

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
Well, if the community likes it so much. Have fun with it. I will leave as I have left the Developer Forums at Apple because they became unusable. > On 9 Feb 2017, at 15:17, Adrian Zubarev > wrote: > > The quote below made my day dear Swift friend as I might remind you that if > modern is as

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Karl Wagner via swift-users
Happy dance! 🎉🕺🎉 I've said before that I think this a good move. Hopefully it encourages more ad-hoc contributions - e.g. Unicode experts who have suggestions for the String model, Perl developers with suggestions for pattern-matching, systems architects with suggestions f

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
> On 9 Feb 2017, at 14:32, Adrian Zubarev > wrote: > > I’m sorry for you, but I don’t think we’re talking in this thread about being > old and wearing glasses or not. My eyes aren’t the best either, but I’m not > complaining about that or try to make this as an argument against > minimalisti

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
> On 9 Feb 2017, at 13:50, Adrian Zubarev > wrote: > > That last one is horrible to even look at (that’s my personal point of view). > It’s packed full with unnecessary UI, which reminds me of the time when > html-tables ruled all over the place. Discourse has a nice minimalistic look > and

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Jan Neumüller via swift-users
My problem with Discourse lies in its terrible ui. It is like most modern social media: totally useless to find stuff and stay organized in it. It reminds my heavy on the terrible ui of Facebook and the redone developer forums at Apple that have gone from fine to utterly useless chaos. Perhaps

Re: [swift-users] Problem with console apps

2017-02-09 Thread Andrey Fidrya via swift-users
A follow-up: flushing stdout works in console, but not in Xcode. Neither setbuf(stdout, nil) nor fflush(stdout) helps, so it appears this is an Xcode issue. import Darwin setbuf(stdout, nil) while true { print("A question.") print("Your answer: ", terminator: "") // not printed //ff

Re: [swift-users] [swift-evolution] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Tino Heth via swift-users
Great news — and I guess it's a plus that Discourse isn't PHP but Ruby, as I expect there are quite a lot Rubyists around here. So, hopefully the issues that might exist (especially with the mail interface) can be addressed to make everyone happy. Although Discourse looks like a really good fit,

Re: [swift-users] Collection Oddities

2017-02-09 Thread Dave Abrahams via swift-users
on Tue Feb 07 2017, Guillaume Lessard wrote: >> On 7 févr. 2017, at 21:57, Slava Pestov wrote: >> >>> >>> On Feb 7, 2017, at 8:14 PM, Guillaume Lessard via swift-users >>> wrote: >>> > >>> I keep running into weird things with Swift 3 Collections. >>> >>> A) Collection has its count prope

Re: [swift-users] Plan to move swift-evolution and swift-users mailing lists to Discourse

2017-02-09 Thread Martin Man via swift-users
Is there any reason why there needs to be a separate tool for this? If mailing lists are no go why not just stay on GitHub and use GitHub issues for proposals? Thanks, Martin > On 9 Feb 2017, at 08:51, Jens Alfke via swift-users > wrote: > > >> On Feb 8, 2017, at 4:48 PM, Jan Neumüller via