Re: [swift-users] OptionSet as Sequence

2017-03-13 Thread J.E. Schotsman via swift-users
On 12 Mar 2017, at 23:23, Zhao Xin wrote: > I don't see the needs to call `for domain in domains` with > `domains:OptionSet`. If a parameter want an OptionSet, why not just > use`domains` directly instead of `domain`? You are right, I was writing bad code. When working with

Re: [swift-users] OptionSet as Sequence

2017-03-12 Thread Zhao Xin via swift-users
I don't see the needs to call `for domain in domains` with `domains:OptionSet`. If a parameter want an OptionSet, why not just use`domains` directly instead of `domain`? Zhaoxin On Mon, Mar 13, 2017 at 12:09 AM, J.E. Schotsman via swift-users < swift-users@swift.org> wrote: > Hello, > >

[swift-users] OptionSet as Sequence

2017-03-12 Thread J.E. Schotsman via swift-users
Hello, Recently I wrote code like this: let domains:[FileManager.SearchPathDomainMask] = [.userDomainMask, .localDomainMask, .networkDomainMask] for domain in domains { … } But I would prefer this: let domains:FileManager.SearchPathDomainMask = [.userDomainMask,.localDomainMask,