Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-27 Thread T.J. Usiyan via swift-evolution
+1 from me. I have, all along, wished that we could use the designated/convenience initializer patterns with structs. This moves us a little bit closer, at least. On Mon, Nov 27, 2017 at 11:05 AM, Slava Pestov via swift-evolution < swift-evolution@swift.org> wrote: > > > On Nov 27, 2017, at

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-27 Thread Slava Pestov via swift-evolution
> On Nov 27, 2017, at 11:04 AM, Ben Langmuir wrote: > > > >> On Nov 17, 2017, at 5:59 PM, Slava Pestov > > wrote: >> >> >> >>> On Nov 17, 2017, at 8:57 PM, Jordan Rose via swift-evolution >>>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-27 Thread Ben Langmuir via swift-evolution
> On Nov 17, 2017, at 5:59 PM, Slava Pestov wrote: > > > >> On Nov 17, 2017, at 8:57 PM, Jordan Rose via swift-evolution >> > wrote: >> >> >> >>> On Nov 17, 2017, at 15:20, Ben Langmuir

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-20 Thread Slava Pestov via swift-evolution
> On Nov 20, 2017, at 11:14 PM, Drew Crawford wrote: > > It would improve the important clients without harming other clients to use > the following implementation for our type: if the sorted accessor is used > before the unsorted one, sort the underlying storage,

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-20 Thread Drew Crawford via swift-evolution
> How so? It seems that encapsulation is orthogonal to reference/value > semantics. Consider this type public struct Mailbox {     private var _messages: [String]     public mutating func append(message: String) { _messages.append(message)}     public var messages: [String] { return _messages}  

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-20 Thread Slava Pestov via swift-evolution
> On Nov 20, 2017, at 1:58 PM, Drew Crawford via swift-evolution > wrote: > > I'm "weak oppose" on this proposal. > > The core premise here is to increase the encapsulation of a struct around its > member variables. But I think the purview of encapsulation is

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-20 Thread Drew Crawford via swift-evolution
I'm "weak oppose" on this proposal. The core premise here is to increase the encapsulation of a struct around its member variables.  But I think the purview of encapsulation is more classes than structs.  e.g. a struct leaks information about the mutation of its member variables, even if those

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-17 Thread Slava Pestov via swift-evolution
> On Nov 17, 2017, at 8:57 PM, Jordan Rose via swift-evolution > wrote: > > > >> On Nov 17, 2017, at 15:20, Ben Langmuir > > wrote: >> >> Hi Jordan, >> >> First off, this is clearly the model we should have had

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-17 Thread Jordan Rose via swift-evolution
> On Nov 17, 2017, at 15:20, Ben Langmuir wrote: > > Hi Jordan, > > First off, this is clearly the model we should have had all along ;-) That > said, I have a concern about source-compat and our ability to automatically > migrate code impacted by this change. >>

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-17 Thread Ben Langmuir via swift-evolution
Hi Jordan, First off, this is clearly the model we should have had all along ;-) That said, I have a concern about source-compat and our ability to automatically migrate code impacted by this change. > Source compatibility > > This makes existing code invalid in Swift 5, which is a source

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-14 Thread Jordan Rose via swift-evolution
Hi, everyone, proposal author here. Caveat: I'll be on vacation for the last few days of this review period, so I won't see your comments after Saturday the 18th (and possibly not even then, if you send them too late in the day). This is fine, of course, but if you have questions for me I may

Re: [swift-evolution] [swift-evolution-announce] [Review] SE-0189: Restrict Cross-module Struct Initializers

2017-11-14 Thread Hooman Mehr via swift-evolution
+1 It should have been like this from the get go. > On Nov 14, 2017, at 11:31 AM, Ted Kremenek wrote: > > The review of "SE-0189: Restrict Cross-module Struct Initializers" begins now > and runs through November 21, 2017. > > The proposal is available here: > >