[swift-users] Are all extensions from all modules exported on mass?

2017-04-19 Thread Howard Lovatt via swift-users
Hi, If I have the *same* extension in two *different* modules, ModuleA and ModuleB, and ModuleC uses both modules, but in *seperate* files, then there is still ambiguity about which extension to call: ModuleA A.swift public protocol P { func m() -> String } extension Int: P { public func m(

Re: [swift-users] Swift creduce

2017-04-19 Thread Huon Wilson via swift-users
Sorry, I was inaccurate: there’s also some syntactic constructs that don’t get minimized as much as they could because they’re too “complicated". The most common one I’ve noticed is instance variable without defaults: creduce doesn’t seem to be able to coordinate removing both declaration and th

Re: [swift-users] Swift creduce

2017-04-19 Thread Doug Hill via swift-users
Wow, very cool. I'm not going to lie, creduce really does have some magic going on. :) Thanks everyone, I'll go back to creduce and see how it handles Swift. Doug Hill > On Apr 19, 2017, at 5:21 PM, Huon Wilson wrote: > > No; Swift just looks C-like enough that many of the various heuristics

Re: [swift-users] Swift creduce

2017-04-19 Thread Huon Wilson via swift-users
No; Swift just looks C-like enough that many of the various heuristics creduce has still work reasonably efficiently. Unless one's “good or not” script is doing something weird, the areas where creduce doesn’t understand Swift are ignored, because the compiler output is not going to match what t

Re: [swift-users] Swift creduce

2017-04-19 Thread Doug Hill via swift-users
Ok, that's unexpected. Does creduce know about Swift now? Doug Hill > On Apr 19, 2017, at 5:13 PM, Slava Pestov wrote: > > Huon noticed that creduce actually works pretty well with Swift as-is. I’ve > been using it without any issues. > > Slava > >> On Apr 19, 2017, at 3:53 PM, Doug Hill vi

Re: [swift-users] Swift creduce

2017-04-19 Thread Slava Pestov via swift-users
Huon noticed that creduce actually works pretty well with Swift as-is. I’ve been using it without any issues. Slava > On Apr 19, 2017, at 3:53 PM, Doug Hill via swift-users > wrote: > > Is there a version of 'creduce' for Swift? > > I did some basic googling and didn't find anything, so I th

[swift-users] Swift creduce

2017-04-19 Thread Doug Hill via swift-users
Is there a version of 'creduce' for Swift? I did some basic googling and didn't find anything, so I thought I'd ask here. Thanks. Doug Hill ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] [swift-evolution] Low efficiency multidimensional array problem

2017-04-19 Thread Jaden Geller via swift-users
Hi Hbucius, You can define your own `Array2D` type that uses a 1-dimensional array as backing (for fast performance) but exposes a high-level 2-dimensional array API. Here’s a really primitive starting point I found on GitHub: https://github.com/raywenderlich/swift-algorithm-club/blob/master/Arr

Re: [swift-users] odd `==` `!=` behavior with class that inherits `NSObject`

2017-04-19 Thread Zhao Xin via swift-users
Hi Nate, It my personal habit to use do-block to compare different Objects with the same name. For example, do { class A { // some staff } let a = A() // some other staff } do { class A { func foo() {} // some staff } let a = A()

Re: [swift-users] String init from Int8 tuple?

2017-04-19 Thread Quinn "The Eskimo!" via swift-users
On 19 Apr 2017, at 09:14, Martin R wrote: > Some authoritative response from SwiftLand™ would be much appreciated. I still don’t work on the Swift compiler (-: but I thought I’d share this quote that recently came by on swift-evolution: On 17 Apr 2017, at 22:18, Michael Ilseman via swift-evol

Re: [swift-users] String init from Int8 tuple?

2017-04-19 Thread Martin R via swift-users
This reminds me of my previous question https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20170220/004841.html > Is that simplified guaranteed to work? The Swift book says that > > > As an optimization, whe

Re: [swift-users] String init from Int8 tuple?

2017-04-19 Thread Quinn "The Eskimo!" via swift-users
On 19 Apr 2017, at 02:11, Rick Mann via swift-users wrote: > In my C-interop, I have a need to do this a lot: I think you’re working too hard here. Try this: func callbackFailed(info inInfo: lgs_result_info_t) { var m = inInfo.message let message = String(cString: &m.0) debugLog("Fa