Re: [swift-users] Generic factory method and type inference

2016-03-19 Thread Brent Royal-Gordon via swift-users
> final class Something { > > let value: T > > init(initial: T) { > value = initial > } > > } > > extension Something { > > class func zip(a: A, _ b: B) -> Something<(A, B)> { > let initial = (a, b) > return Something<(A, B)>(initial: ini

Re: [swift-users] Swift on a cluster?

2016-03-19 Thread Paul Schifferer via swift-users
This is incorrect. swift-lang.org is a completely unrelated language that happens to be called Swift. The official site for Apple’s Swift is swift.org. --  Paul Schifferer Sent with Airmail On March 18, 2016 at 10:53:48, Ramakrishna Mallireddy via swift-users (swift-users@swift.org) wrote: swi

Re: [swift-users] Generic factory method and type inference

2016-03-19 Thread Dmitri Gribenko via swift-users
On Thu, Mar 17, 2016 at 6:58 AM, Rudolf Adamkovič wrote: > How come I can’t call zip without explicitly specifying return type? > > // ERROR: Cannot invoke `zip` with an argument list of type `(Int, Int)` > let y = Something.zip(1, 2) The compiler can't infer T from your call. T and (A, B) are t

Re: [swift-users] Problems building with dependency

2016-03-19 Thread Max Howell via swift-users
> I have a package I am building that I have introduced a dependency for, but > swift build is failing. It looks like a git error: > > gbn-sstudies-mv:SmarkDown sstudies$ swift build > Cloning https://github.com/SwiftStudies/Duration.git > /usr/local/bin/git -C > /Users/sstudies/Documents/Code/

Re: [swift-users] Swift on a cluster?

2016-03-19 Thread Ramakrishna Mallireddy via swift-users
swift-lang.org is official website for Apple Swift Language. C, ObjC , C++[need to write C/ObjC wrapper] libraries can be used with swift code. The swift compiler currently works on mac & linux. On Fri, Mar 18, 2016 at 10:42 PM, Graymalk Meow via swift-users < swift-users@swift.org> wrote: > Hi

Re: [swift-users] [swift-dev] Collection underestimatedCount() does _?

2016-03-19 Thread Brent Royal-Gordon via swift-users
> You gave cases for which `underestimatedCount()` is used: >> For sequences with easily-calculated counts, this should give us a size >> that's just right. For sequences where they can kind of estimate the right >> count (for instance, if you're decoding a fixed-size buffer of UTF-8 bytes, >> a

Re: [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Brent Royal-Gordon via swift-users
> 1: that the standard API requires that > every Sequence type can be instantiated so as to replicate the contents of > another? The whole value of Sequence to the examples is that it should be > impossible. No, it's the other way around. It should be possible to copy any (finite) Sequence in

Re: [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Will Stanton via swift-users
Hello Brent, Thanks kindly for the flair! You gave cases for which `underestimatedCount()` is used: > For sequences with easily-calculated counts, this should give us a size > that's just right. For sequences where they can kind of estimate the right > count (for instance, if you're decoding a

Re: [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Fritz Anderson via swift-users
On Mar 19, 2016, at 2:53 PM, Brent Royal-Gordon via swift-users wrote: >>> I might have missed something since a lot of the results are for tests >>> >>> But why would `underestimatedCount` ever be used instead of `c

[swift-users] Object size on heap

2016-03-19 Thread Howard Lovatt via swift-users
Hi, Is there a way to find out how big an object is on the heap? Cheers, — Howard. PS I did search swift-users but no luck :( ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Brent Royal-Gordon via swift-users
>> I might have missed something since a lot of the results are for tests >> >> But why would `underestimatedCount` ever be used instead of `count`? Don’t >> most collections have O(1) `count` anyway? > > Hi Will, >

Re: [swift-users] Generic factory method and type inference

2016-03-19 Thread Chris Lattner via swift-users
On Mar 17, 2016, at 6:58 AM, Rudolf Adamkovič via swift-users wrote: > > How come I can’t call zip without explicitly specifying return type? > > // ERROR: Cannot invoke `zip` with an argument list of type `(Int, Int)` > let y = Something.zip(1, 2) > > // OK: Works but it’s unacceptable to req

Re: [swift-users] Collection underestimatedCount() does _?

2016-03-19 Thread Fritz Anderson via swift-users
On Mar 19, 2016, at 1:08 AM, Dmitri Gribenko via swift-users wrote: > > This API comes from Sequence, which does not have a count that you can > inspect without possibly consuming the sequence. Am I right that notionally-infinite sequences (like bytes from a random-number generator) should rep

[swift-users] Generic factory method and type inference

2016-03-19 Thread Rudolf Adamkovič via swift-users
Hello there! I have the following class with a generic factory method: final class Something { let value: T init(initial: T) { value = initial } } extension Something { class func zip(a: A, _ b: B) -> Something<(A, B)> { let initial = (a, b)

[swift-users] Problems building with dependency

2016-03-19 Thread Swift Studies via swift-users
I have a package I am building that I have introduced a dependency for, but swift build is failing. It looks like a git error:  gbn-sstudies-mv:SmarkDown sstudies$ swift build Cloning https://github.com/SwiftStudies/Duration.git /usr/local/bin/git -C /Users/sstudies/Documents/Code/Swift/SPM/Pac

Re: [swift-users] Superclass constraint cannot depend on type parameter

2016-03-19 Thread Jon Shier via swift-users
Slava: I won’t be able to test my actual code, as the Operations and Alamofire libraries haven’t been updated for Swift 3 (which I wouldn’t expect), but I’ll try to put together a test cast that is similar and see if it works? When will this change be part of the package I can download f

Re: [swift-users] [swift-evolution] Potential Bug with Compiler in 2.1.1 and UnitTests

2016-03-19 Thread Joe Groff via swift-users
(bcc'ing swift-evolution, adding swift-users) This list is for language design discussion. If you have a bug, please file it at bugs.swift.org, or discuss it on swift-users. -Joe > On Mar 18, 2016, at 10:11 AM, James Campbell via swift-evolution > wrote: > > > I have a class that specifies

Re: [swift-users] Superclass constraint cannot depend on type parameter

2016-03-19 Thread Slava Pestov via swift-users
Hi Jon, You are right that this is a limitation of the current implementation in Swift 2.2. I may have fixed this recently in master: https://github.com/apple/swift/commit/3aacf5d805768527b59d24e6da2a03911b3dd5b0

Re: [swift-users] Problems building with dependency

2016-03-19 Thread Nigel Hughes via swift-users
The machine is old... I have done many things. Only some of them I can remember :-/ Thank you for your help, I'll get it sorted. Sent from my iPhone > On 17 Mar 2016, at 19:54, Max Howell wrote: > > More likely this is from brew or macports. Xcode has shipped a newer version > for a long t

Re: [swift-users] libswift frontend ios

2016-03-19 Thread Joe Groff via swift-users
> On Mar 17, 2016, at 2:22 PM, Ramakrishna Mallireddy > wrote: > > The libLLVMContainer.dylib is actually from opengl.framework. > On iOS the lib may be loaded by opengles.framework and I am not using any > opengl myself, ios may be loading it by default. > > I have compiled llvm core & supp

[swift-users] Installing Package manager

2016-03-19 Thread Cilia Vandenameele via swift-users
Hello, I'm trying to install your package manager on my computer (MacBook Pro, OSX El Capitan 10.11.3) to use in Xcode (7.2.1). I started from the Github page (https://github.com/apple/swift-package-manager ), but I really don't get it installed. I

Re: [swift-users] Swift on a cluster?

2016-03-19 Thread Graymalk Meow via swift-users
Apparently I anonymized myself when I signed up to this mailing list. Apologies for the strange name. I had forgotten I had done that. My name is Vicky and I'm a grad student in high performance computing. My questions still stand and if anyone is using Apple's Swift in any work, I would love to ge

Re: [swift-users] Installing Package manager

2016-03-19 Thread Max Howell via swift-users
The swift in /usr/bin does not know about the swift toolchain you have installed. You need to add the swift from the /usr/bin in your toolchain to the PATH first. Once Xcode 7.3 lands you’ll be able to set TOOLCHAINS=swift as an environment variable and then you won’t need to set the PATH. >

Re: [swift-users] Generic factory method and type inference

2016-03-19 Thread Rudolf Adamkovič via swift-users
Thanks for all the information. This was a cross-post from Stack Overflow: http://stackoverflow.com/questions/36061561/generic-factory-method-and-type-inference If you are a Stack Overflow user, you can copy