Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Greg Parker via swift-evolution
> On Nov 15, 2016, at 6:42 PM, Charles Srstka via swift-evolution > wrote: > >> On Nov 15, 2016, at 7:27 PM, Karl via swift-evolution >> > wrote: >> >> In Objective-C, asking whether or not an object

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Shawn Erickson via swift-evolution
Again my point isn't worrying about point of calling out to the delegate but configuring my delegator to avoid a body of work or state management that is unneeded if the delegate doesn't care about some mix of potential delegation points. I was trying to point out things to consider for those

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Karl via swift-evolution
> On 16 Nov 2016, at 03:42, Charles Srstka wrote: > >> On Nov 15, 2016, at 7:27 PM, Karl via swift-evolution >> > wrote: >> >> In Objective-C, asking whether or not an object conforms to a protocol just >>

Re: [swift-evolution] Getting a list of protocol conformers

2016-11-15 Thread Rick Mann via swift-evolution
+1. > On Nov 15, 2016, at 19:53 , Jonathan Hull via swift-evolution > wrote: > > I would like to be able to get, at runtime, an array of all types conforming > to a particular protocol. (Similarly, I would like to be able to get an > array of all subtypes of a

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Karl via swift-evolution
> On 16 Nov 2016, at 04:37, Shawn Erickson wrote: > > I think you are fixating on my talk about imp caching instead of my main > point about setting up the state of my delegator to avoid unneeded work when > a registered delegate hasn't implement a delegation point. It an

[swift-evolution] Getting a list of protocol conformers

2016-11-15 Thread Jonathan Hull via swift-evolution
I would like to be able to get, at runtime, an array of all types conforming to a particular protocol. (Similarly, I would like to be able to get an array of all subtypes of a given type). Is this in the generics manifesto? If not, can it be added? What is the timeframe? It seems to me,

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Shawn Erickson via swift-evolution
I think you are fixating on my talk about imp caching instead of my main point about setting up the state of my delegator to avoid unneeded work when a registered delegate hasn't implement a delegation point. It an unrelated topic to what is being discussed. -Shawn On Tue, Nov 15, 2016 at 5:27

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Charles Srstka via swift-evolution
> On Nov 15, 2016, at 7:27 PM, Karl via swift-evolution > wrote: > > In Objective-C, asking whether or not an object conforms to a protocol just > cascades in to a bunch of calls to “respondsToSelector”, so it’s also very > painful. This isn’t true; Objective-C

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Karl via swift-evolution
> On 15 Nov 2016, at 19:38, Shawn Erickson wrote: > > Using sub-protocols may be sufficient and make sense... to be honest I > haven't had the time to fully explore this space and convert some things I > have done in objective-c to pure swift. I do wonder how often that

Re: [swift-evolution] Selector for current method

2016-11-15 Thread Rudolf Adamkovič via swift-evolution
> What I’m wondering is what you’re actually using this all for. For example, when testing with Quick (popular testing framework), one can describe a function: describe(“player.play()”) { ... } If #function worked like #selector, we could do: describe(#function(Player.play())) { ...

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Rick Mann via swift-evolution
> On Nov 15, 2016, at 09:24 , Dave Abrahams via swift-evolution > wrote: > > Speaking for myself: I think “probe-a-type” programming is in general a > bad idea, and I'm opposed to adding features that encourage it. It's > almost always better to design entry points

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Chris Lattner via swift-evolution
> On Nov 14, 2016, at 3:48 PM, Rick Mann via swift-evolution > wrote: > > Will Swift ever support optional methods without @objc? > We discussed this extensively in the Swift 3 timeframe, and I believe that the consensus was “no”: optional requirements are

Re: [swift-evolution] [Out of scope] Discussion on general Darwin/GlibC module

2016-11-15 Thread Alex Blewitt via swift-evolution
OpenVMS isn't in the supported list of Swift packages, so comparing it to that is pointless. https://github.com/apple/swift/blob/c3b7709a7c4789f1ad7249d357f69509fb8be731/lib/Basic/LangOptions.cpp#L26-L36 static const StringRef SupportedConditionalCompilationOSs[] = { "OSX", "tvOS",

Re: [swift-evolution] [Out of scope] Discussion on general Darwin/GlibC module

2016-11-15 Thread Drew Crawford via swift-evolution
Thanks for using specific examples, as they are illustrative. Or, as used in https://github.com/drewcrawford/Caroline/blob/edd8aefef44717ecfa03c629100baf095fab983a/caroline-static-tool/main.swift to just get access to the exit() function, which is the same across all platforms. exit is an

Re: [swift-evolution] Fwd: about protocols

2016-11-15 Thread Reynaldo Aguilar Casajuana via swift-evolution
Yes, that would be a classic factory method. However, what I want is to take advantage of the power of protocol extensions and use them for improving the way in which dependencies are resolved in most classic programming languages. The current meaning of static method/property in protocols, how

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Shawn Erickson via swift-evolution
Using sub-protocols may be sufficient and make sense... to be honest I haven't had the time to fully explore this space and convert some things I have done in objective-c to pure swift. I do wonder how often that those sub-protocols would degenerate into having single methods. In a nut shell it

Re: [swift-evolution] Fwd: about protocols

2016-11-15 Thread David Waite via swift-evolution
A static method or property on a protocol already means something separate - that the types which implement that protocol that static method/property. I’d recommend moving your factory method to another type or a global function? -DW > On Nov 15, 2016, at 10:10 AM, Reynaldo Aguilar Casajuana

[swift-evolution] Fwd: about protocols

2016-11-15 Thread Reynaldo Aguilar Casajuana via swift-evolution
Hi. I was thinking about a simple way of implementing the handling of dependencies in swift and arrived to the following solution, however, currently it isn't supported in swift. Can we get a way of making this work? http://stackoverflow.com/questions/40595621/getting-

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Haravikk via swift-evolution
> On 15 Nov 2016, at 14:59, Karl wrote: >> On 15 Nov 2016, at 12:22, Haravikk via swift-evolution >> > wrote: >> What's different about having the method return nil vs being optional? >> You're attempting to call

Re: [swift-evolution] Selector for current method

2016-11-15 Thread Timothy J. Wood via swift-evolution
> On Nov 14, 2016, at 11:07 AM, Jordan Rose via swift-evolution > wrote: > > This doesn’t seem unreasonable, but I’m not sure if that makes it reasonable. > :-) What’s your use case? The stripped-down code seems like it could use any > unique key, including

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Dave Abrahams via swift-evolution
on Tue Nov 15 2016, Shawn Erickson wrote: > This has been discussed somewhat heavily in the past and nothing yet has > really moved forward on it. I do think a good way of doing something like > this would be helpful. I have resulted to defining an interface with an >

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Karl via swift-evolution
> On 15 Nov 2016, at 16:46, Shawn Erickson wrote: > > This has been discussed somewhat heavily in the past and nothing yet has > really moved forward on it. I do think a good way of doing something like > this would be helpful. I have resulted to defining an interface with

Re: [swift-evolution] Selector for current method

2016-11-15 Thread Jordan Rose via swift-evolution
Sorry, I see that #function doesn’t work as a drop-in replacement for #selector. What I’m wondering is what you’re actually using this all for. It seems rare to have a dictionary keyed by the name of a function (but not its arguments) and rarer still to need to prepopulate that dictionary. The

Re: [swift-evolution] [Out of scope] Discussion on general Darwin/GlibC module

2016-11-15 Thread Alex Blewitt via swift-evolution
> On 11 Nov 2016, at 03:48, Drew Crawford wrote: > > grep -R "import Glibc" ~/Code --include "*.swift" | wc -l > 297 > > As someone who might be characterized as suffering from the problem this > proposal purports to solve, I am not convinced. > > The primary

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Karl via swift-evolution
> On 15 Nov 2016, at 12:22, Haravikk via swift-evolution > wrote: > > >> On 15 Nov 2016, at 07:53, Rick Mann via swift-evolution >> > wrote: >> >> >>> On Nov 14, 2016, at 22:51 , Charlie Monroe via

Re: [swift-evolution] Selector for current method

2016-11-15 Thread Rudolf Adamkovič via swift-evolution
Hi Jordan, > The stripped-down code seems like it could use any unique key, including > #function. That would work only if #function could be used with an argument just like #selector: class DirectoryListingStub: DirectoryListing { var cannedOutput: [Selector: Any?] = [

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Haravikk via swift-evolution
> On 15 Nov 2016, at 07:53, Rick Mann via swift-evolution > wrote: > > >> On Nov 14, 2016, at 22:51 , Charlie Monroe via swift-evolution >> wrote: >> >> One major example is the NS/UITableViewDataSource or Delegate - there are >> many

Re: [swift-evolution] [Proposal] Type Narrowing

2016-11-15 Thread Haravikk via swift-evolution
> On 15 Nov 2016, at 07:19, Jean-Daniel wrote: >> Le 14 nov. 2016 à 10:10, Haravikk > > a écrit : >>> On 13 Nov 2016, at 16:16, Jean-Daniel via swift-evolution >>>

Re: [swift-evolution] Will Swift ever support optional methods without @objc?

2016-11-15 Thread Charlie Monroe via swift-evolution
> On Nov 15, 2016, at 8:53 AM, Rick Mann wrote: > > >> On Nov 14, 2016, at 22:51 , Charlie Monroe via swift-evolution >> wrote: >> >> One major example is the NS/UITableViewDataSource or Delegate - there are >> many many methods that you