Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-11-26 Thread Benjamin Garrigues via swift-evolution
Is there another proposal directly related to namespacing ? This would seem like addressing a bit of the same issue.. As an example i would much prefer writing something like : Package UITableView Class Table : UIView Class Cell : UIView Protocol Delegate Protocol Datasource With each class in

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-11-26 Thread Jonathan Hull via swift-evolution
I would use this pretty much constantly! I thought it was going to be in Swift 4, and have really been missing it… > On Nov 26, 2017, at 8:51 AM, Adrian Zubarev via swift-evolution > wrote: > > > What happened to this? Should we revive this talk? I’d love to

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-11-26 Thread Adrian Zubarev via swift-evolution
What happened to this? Should we revive this talk? I’d love to finally be able to nest protocols in Swift 5 and clean up my code. Am 18. Januar 2017 um 09:48:20, Slava Pestov via swift-evolution (swift-evolution@swift.org) schrieb: I left some review comments here:

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-18 Thread Slava Pestov via swift-evolution
I left some review comments here: https://github.com/apple/swift-evolution/commit/ff654e4 Slava > On Jan 18, 2017, at 12:17 AM, Karl Wagner wrote: > > >> On 18 Jan 2017, at 01:07, Douglas Gregor > > wrote: >> >> >>> On Nov

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-18 Thread Karl Wagner via swift-evolution
> On 18 Jan 2017, at 01:07, Douglas Gregor wrote: > > >> On Nov 5, 2016, at 2:44 AM, Karl via swift-evolution >> > wrote: >> >>> >>> On 2 Nov 2016, at 20:54, Slava Pestov >>

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-17 Thread Matthew Johnson via swift-evolution
+1. Nesting protocols inside an “owning" type and importing prefixed Objective-C protocols this way would be great! > On Jan 17, 2017, at 6:15 PM, T.J. Usiyan via swift-evolution > wrote: > > +1 to all of that. The proposal in general and the import rule. > > On

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-17 Thread T.J. Usiyan via swift-evolution
+1 to all of that. The proposal in general and the import rule. On Tue, Jan 17, 2017 at 7:07 PM, Douglas Gregor via swift-evolution < swift-evolution@swift.org> wrote: > > On Nov 5, 2016, at 2:44 AM, Karl via swift-evolution < > swift-evolution@swift.org> wrote: > > > On 2 Nov 2016, at 20:54,

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-17 Thread Jonathan Hull via swift-evolution
+1 I really want protocols which can be namespaced inside structs/classes! Thanks, Jon > On Jan 17, 2017, at 4:07 PM, Douglas Gregor via swift-evolution > wrote: > > >> On Nov 5, 2016, at 2:44 AM, Karl via swift-evolution >>

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2017-01-17 Thread Douglas Gregor via swift-evolution
> On Nov 5, 2016, at 2:44 AM, Karl via swift-evolution > wrote: > >> >> On 2 Nov 2016, at 20:54, Slava Pestov > > wrote: >> >>> >>> On Nov 2, 2016, at 8:32 AM, Paul Cantrell >>

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-11-05 Thread Adrian Zubarev via swift-evolution
Disappointed to see that you just ignored everything I pitched to you. The proposal does not cover extensions nor it it sees the problem with access modifier which it creates. public protocol A { // Not allowed to use any access modifier here at all struct B { // Nor here

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-11-05 Thread Karl via swift-evolution
> On 2 Nov 2016, at 20:54, Slava Pestov wrote: > >> >> On Nov 2, 2016, at 8:32 AM, Paul Cantrell wrote: >> >> >>> On Oct 24, 2016, at 4:43 PM, Slava Pestov wrote: >>> >>> On Oct 24, 2016, at 8:12 AM, Paul Cantrell

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-11-02 Thread Slava Pestov via swift-evolution
> On Nov 2, 2016, at 8:32 AM, Paul Cantrell wrote: > > >> On Oct 24, 2016, at 4:43 PM, Slava Pestov wrote: >> >> >>> On Oct 24, 2016, at 8:12 AM, Paul Cantrell wrote: >>> >>> On Oct 24, 2016, at 5:09 AM, Slava Pestov via

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-11-02 Thread Paul Cantrell via swift-evolution
> On Oct 24, 2016, at 4:43 PM, Slava Pestov wrote: > > >> On Oct 24, 2016, at 8:12 AM, Paul Cantrell wrote: >> >> >>> On Oct 24, 2016, at 5:09 AM, Slava Pestov via swift-evolution >>> wrote: >>> >>> However protocols

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Karl via swift-evolution
> On 25 Oct 2016, at 00:06, Karl wrote: > > >> On 24 Oct 2016, at 20:23, Jonathan Hull via swift-evolution >> > wrote: >> >>> FWIW, in almost all the situations where I’ve wanted to nest types

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Karl via swift-evolution
> On 24 Oct 2016, at 20:23, Jonathan Hull via swift-evolution > wrote: > >> FWIW, in almost all the situations where I’ve wanted to nest types inside >> protocols and generic types, it’s only as a namespacing convenience. Most >> often, it’s an enum type that’s

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Jonathan Hull via swift-evolution
> FWIW, in almost all the situations where I’ve wanted to nest types inside > protocols and generic types, it’s only as a namespacing convenience. Most > often, it’s an enum type that’s used only by a single method, and having it > at the top of the module namespace adds clutter. >

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Paul Cantrell via swift-evolution
> On Oct 24, 2016, at 5:09 AM, Slava Pestov via swift-evolution > wrote: > > However protocols nested inside types and types nested inside protocols is > still not supported, because protocols introduce a separate series of issues > involving associated types and

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Slava Pestov via swift-evolution
Hi Karl, I just saw your draft after sending my first reply earlier; I posted some additional comments on the gist. Also I remembered that Jordan Rose and I were talking about this recently in the context of the ClangImporter, so I'm CCing him in case he wants to share some thoughts. > On

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-24 Thread Slava Pestov via swift-evolution
> On Oct 17, 2016, at 11:35 AM, Karl via swift-evolution > wrote: > > >> On 17 Oct 2016, at 20:31, Adrian Zubarev via swift-evolution >> > wrote: >> >> That’s also on the line: >>

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-22 Thread Adrian Zubarev via swift-evolution
First of all, thank you for writing the formal proposal. To begin with, I’d like to remember you that type nesting is not only done through nesting types directly in concrete types. A commonly used pattern to reduce clustering is nesting inside extensions: extension TypeName { class

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-21 Thread Karl via swift-evolution
> On 22 Oct 2016, at 04:12, Karl wrote: > > >> On 22 Oct 2016, at 04:07, Karl > > wrote: >> >> >>> On 22 Oct 2016, at 04:02, Braeden Profile >>

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-21 Thread Karl via swift-evolution
> On 22 Oct 2016, at 04:07, Karl wrote: > > >> On 22 Oct 2016, at 04:02, Braeden Profile > > wrote: >> >> But what would that mean? If I reference `ProtocolName.InnerType`, that >> doesn’t always have

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-21 Thread Karl via swift-evolution
> On 22 Oct 2016, at 04:02, Braeden Profile wrote: > > But what would that mean? If I reference `ProtocolName.InnerType`, that > doesn’t always have meaning. In fact, if you have two different extensions > where AssociatedType equals something else, there’s a type

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-21 Thread Braeden Profile via swift-evolution
But what would that mean? If I reference `ProtocolName.InnerType`, that doesn’t always have meaning. In fact, if you have two different extensions where AssociatedType equals something else, there’s a type ambiguity from other code. I suspect it would only work if that InnerType was mandated

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-21 Thread Karl via swift-evolution
I had a go at writing this up formally: https://gist.github.com/karwa/4c6bff75f8fa84b16df2c8caae97d622 Is there anything I missed? - Karl > On 17 Oct 2016, at 20:44, Adrian Zubarev > wrote: >

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread Adrian Zubarev via swift-evolution
That’s also on the line: [https://github.com/apple/swift/blob/611fc78d28a5da97dd1bea40761b913b1077aef5/docs/GenericsManifesto.md#nested-generics](https://github.com/apple/swift/blob/611fc78d28a5da97dd1bea40761b913b1077aef5/docs/GenericsManifesto.md#nested-generics) --  Adrian Zubarev Sent with

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread T.J. Usiyan via swift-evolution
I want this feature. Both class in protocol and protocol in class could clean up many relationships but I think that a blocking concern is "How does this interact with generics?" Nesting types in generic types is already disallowed and how different is this feature from that? On Mon, Oct 17, 2016

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread Charles Srstka via swift-evolution
Extremely strong +1. I’ve got a bunch of Objective-C-style really long type names of the sort “MyProtocol”, “MyProtocolSomeTypeEnum”, “MyProtocolSomeOptionsEnum”, etc. It would be really nice to make those Swiftier. Charles > On Oct 17, 2016, at 12:59 PM, Karl via swift-evolution >

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread Adrian Zubarev via swift-evolution
Two weeks ago there was a similar pitch here https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon–20161003/027643.html In general I’m in favor of this feature, but I don’t know any technical issues this might have or does already have. As I said in the other thread. I’m for nested

Re: [swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread Nevin Brackett-Rozinsky via swift-evolution
I like it! I haven’t thought through the ramifications regarding associated types yet though. Is your vision that each conforming type would have to provide its own nested type as specified by the protocol? Or could the protocol itself define a nested type and anything could use it? protocol

[swift-evolution] [Pitch] Nested types in protocols (and nesting protocols in types)

2016-10-17 Thread Karl via swift-evolution
I was just doing some googling, turns out there was a discussion about nesting protocols in other types that seemed to go positively a long time ago: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160425/016074.html