Re: [swift-users] NSMutableData's init?(length length: Int) initializer

2016-04-14 Thread Dmitri Gribenko via swift-users
On Thu, Apr 14, 2016 at 11:16 PM, Chris Lattner via swift-users wrote: > >> On Apr 14, 2016, at 10:45 AM, soyer via swift-users >> wrote: >> >> Hello Guys, Girls, >> >> Do you know why is the init?(length length: Int) NSMutableData's initializer >> failable? >> The memory allocation can fail, b

Re: [swift-users] NSMutableData's init?(length length: Int) initializer

2016-04-15 Thread Dmitri Gribenko via swift-users
On Fri, Apr 15, 2016 at 10:34 AM, Chris Lattner wrote: > >> On Apr 14, 2016, at 11:22 PM, Dmitri Gribenko wrote: >> >> On Thu, Apr 14, 2016 at 11:16 PM, Chris Lattner via swift-users >> wrote: >>> On Apr 14, 2016, at 10:45 AM, soyer via swift-users wrote: Hello Guys, Girls,

Re: [swift-users] Range.count can abort

2016-04-15 Thread Dmitri Gribenko via swift-users
On Fri, Apr 15, 2016 at 4:23 PM, Jens Alfke via swift-users wrote: > I’m writing some code that deals with ranges of “sequence numbers”, which > are consecutively-assigned positive 64-bit integers, thus Range in > Swift. I’m having trouble handling half-open ranges with no maximum, which > are ver

Re: [swift-users] Range.count can abort

2016-04-15 Thread Dmitri Gribenko via swift-users
On Fri, Apr 15, 2016 at 4:41 PM, Jens Alfke wrote: > > > --Jens [via iPhone] > >> On Apr 15, 2016, at 4:26 PM, Dmitri Gribenko wrote: >> >> The distance is signed so that we can represent negative distances. >> r.distance(from:to:) should be able to measure distances backwards. > > Yeah, make

Re: [swift-users] Range.count can abort

2016-04-16 Thread Dmitri Gribenko via swift-users
On Sat, Apr 16, 2016 at 8:29 AM, wrote: > Is there any reason that Distance has to be a simple Int? Since it’s defined > per-type, UInt64 could use a custom struct without impacting the performance > of other types: It needs to be a signed integer. And a signed integer needs a distance type its

Re: [swift-users] Guarding against an empty sequence

2016-05-09 Thread Dmitri Gribenko via swift-users
On Mon, May 9, 2016 at 8:21 AM, Shane S via swift-users wrote: > On May 9, 2016, at 6:18 AM, Adriano Ferreira > wrote: > > So, I thought about “underestimatedCount” but was not sure how to use it > properly. > > > `guard self.underestimateCount > 0 else {return false}` `underestimateCount` is wh

Re: [swift-users] SubSequence Index bug in generic functions?

2016-05-11 Thread Dmitri Gribenko via swift-users
On Wed, May 11, 2016 at 1:48 PM, Hooman Mehr via swift-users wrote: > The reason this is appearing here before filing a radar is getting a quick > feedback as I have been assuming this is the expected behavior but Nate Cook > told me otherwise. See this thread for the initial discussion that lead

Re: [swift-users] function advancedBy() bugs

2016-05-17 Thread Dmitri Gribenko via swift-users
On Tue, May 17, 2016 at 5:46 AM, zh ao via swift-users wrote: > It seams that I encountered bugs in function advancedBy(). > > do { > var str = "abcdefg" > var range = str.startIndex.. str += "hijklmn" > range.endIndex = str.endIndex // 0..<14 > let index = range.startIndex.adv

Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-05-21 Thread Dmitri Gribenko via swift-users
Hi Adrian, On Sat, May 21, 2016 at 1:48 AM, Adrian Zubarev via swift-users wrote: > I played around with UnsafeMutablePointer and realized one behavior: > > let pString = UnsafeMutablePointer.alloc(1) > pString.initialize("test") > pString.predecessor().memory // will crash ax expected > pString.

Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-05-21 Thread Dmitri Gribenko via swift-users
On Sat, May 21, 2016 at 2:15 AM, Adrian Zubarev via swift-users wrote: > So basically if I do something like this I should be on the safe side: Yes, this code is safe. If you just want to store a contiguous buffer of elements of the same type, you should consider using Array. It has methods tha

Re: [swift-users] build-script error

2016-06-10 Thread Dmitri Gribenko via swift-users
On Fri, Jun 10, 2016 at 9:14 AM, Jeff Ramsey via swift-users wrote: > I followed directions here to clone the compiler source and build it on > Ubuntu 14.04: > > https://github.com/apple/swift/blob/master/README.md Hi Jeff, Which architecture are you running on? Could you run "python" in the te

Re: [swift-users] build-script error

2016-06-10 Thread Dmitri Gribenko via swift-users
Hi Jeff, Karl is right. Swift is not ported to 32-bit Linux right now -- sorry! We would welcome contributions from the community to fill this gap. I would be happy to review the patches and discuss any issues that come up. Dmitri On Fri, Jun 10, 2016 at 8:06 PM, Karl wrote: > i686 is a 32-b

Re: [swift-users] build-script error

2016-06-11 Thread Dmitri Gribenko via swift-users
Hi Jeff, Please take a look at these pull requests and commits to get a general idea of what it takes to port Swift to a new platform: https://github.com/apple/swift/pull/2541 https://github.com/apple/swift/pull/979 https://github.com/apple/swift/commit/83751888c73de2504cbfa87906adf7c526d6fc65 D

Re: [swift-users] AnySequence and type erasure

2016-06-17 Thread Dmitri Gribenko via swift-users
On Fri, Jun 17, 2016 at 1:39 AM, Svein Halvor Halvorsen via swift-users wrote: > I'm sure people here know about the problem that AnySequence, AnyGenerator, > etc solves. > In Swift, a protocol can have an associated type, which is kinda like > generics, but you cannot declare a variable like this

Re: [swift-users] AnySequence and type erasure

2016-06-18 Thread Dmitri Gribenko via swift-users
On Fri, Jun 17, 2016 at 12:37 PM, Svein Halvor Halvorsen wrote: > Ok. Good to hear that I'm not too far off :) > > Can you provide me with an example of a sequence type or two that has some > map or other function that would benefit from an optimized wrapper? Or: > under what circumstances would t

Re: [swift-users] AnySequence and type erasure

2016-06-23 Thread Dmitri Gribenko via swift-users
On Thu, Jun 23, 2016 at 2:12 AM, Svein Halvor Halvorsen wrote: > 2016-06-18 10:23 GMT+02:00 Dmitri Gribenko : >> >> On Fri, Jun 17, 2016 at 12:37 PM, Svein Halvor Halvorsen >> wrote: >> > Ok. Good to hear that I'm not too far off :) >> > >> > Can you provide me with an example of a sequence type

Re: [swift-users] Customizing my custom type's appearance in the debugger

2016-06-26 Thread Dmitri Gribenko via swift-users
On Fri, Jun 24, 2016 at 3:53 PM, Tim Vermeulen via swift-users wrote: > I’ve implemented a linked list. Now I’d like to be able to view the elements > of a linked list in the debugger just like with an array. In the debugger, an > array is represented like this: > > [0] = the first element > [1]

Re: [swift-users] Customizing my custom type's appearance in the debugger

2016-06-26 Thread Dmitri Gribenko via swift-users
On Sun, Jun 26, 2016 at 5:03 PM, Tim Vermeulen wrote: > I already did that, sorry for not providing any code. Take this as an > example: > > public struct Wrapper { > > private var elements: [Element] > > public init(_ sequence: > S) { > elements = [Element](sequence) > } > > }

Re: [swift-users] Can Swift 2.3 frameworks be used with a Swift 3.0 app?

2016-06-27 Thread Dmitri Gribenko via swift-users
On Mon, Jun 27, 2016 at 9:05 AM, Kenny Leung via swift-users wrote: > Hmm… This sounds like a big weakness with the Swift Package Manager. > > Since it downloads and compiles sources, frameworks that might otherwise be > binary compatible to link with might not build and work when you update your

Re: [swift-users] Appending '[element]' recursively

2016-06-27 Thread Dmitri Gribenko via swift-users
On Mon, Jun 27, 2016 at 7:48 AM, Adriano Ferreira via swift-users wrote: > // Swift 3 > > func quickSort(_ array: [Int]) -> [Int] { > guard array.count > 1 else { > return array > } > > let (pivot, rest) = (array.first!, array.dropFirst()) > > let lessThan = rest.filter({ $

Re: [swift-users] Appending '[element]' recursively

2016-06-27 Thread Dmitri Gribenko via swift-users
On Mon, Jun 27, 2016 at 9:44 AM, Adriano Ferreira wrote: > > Here the exact error I’m getting: I see. I think this is a compiler bug, I filed https://bugs.swift.org/browse/SR-1914 . Thanks! Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j*/ ___ swift-us

Re: [swift-users] LazyCollection.map()

2016-06-28 Thread Dmitri Gribenko via swift-users
On Tue, Jun 28, 2016 at 3:37 PM, Aaron Bohannon via swift-users wrote: > Does the code below have a well-defined behavior? It invokes the eager map() that is available on Array.lazy. Array.lazy is a collection, so it has an eager map() from the Collection protocol. The lazy map() does not accept

Re: [swift-users] LazyCollection.map()

2016-06-28 Thread Dmitri Gribenko via swift-users
On Tue, Jun 28, 2016 at 6:07 PM, Aaron Bohannon wrote: > AH! I wasn't familiar enough with the LazyCollectionType protocol to > realize that its map() function had a different signature. > > So, presumably, if I pass a non-throwing closure, the compiler will choose > the lazy map(). However, it'

Re: [swift-users] Checking if an UnsafeMutablePointer is NULL in Swift 3

2016-07-05 Thread Dmitri Gribenko via swift-users
On Tue, Jul 5, 2016 at 3:40 PM, Vinicius Vendramini via swift-users wrote: > Hi all! > > Used to be in Swift 2.x I only had to compare an unsafe pointer (obtained > from a C API) to nil to know whether or not it was NULL. After conversion to > Swift 3, it seems that isn’t allowed anymore. > > I

Re: [swift-users] Equality is broken, isn't it?

2016-07-06 Thread Dmitri Gribenko via swift-users
On Wed, Jul 6, 2016 at 9:54 AM, Alexey Komnin via swift-users wrote: > Here is the code: > > let a: String = "abc" > let b: NSString = "abc" > > assert(a == b) > assert(a.hashValue == b.hashValue, "a.hashValue(\(a.hashValue)) != > b.hashValue(\(b.hashValue))") > > It fails with err

Re: [swift-users] Parsing binary data

2016-07-08 Thread Dmitri Gribenko via swift-users
On Fri, Jul 8, 2016 at 12:15 AM, Tino Heth via swift-users wrote: > Hi there! > > Some weeks ago I wrote a parser for a binary format, but it's performance was > disastrous, and I knew how to easily outperform this first approach with > Objective-C by large. > Now, I'm about to write a different

Re: [swift-users] NSData and UnsafePointer

2016-07-16 Thread Dmitri Gribenko via swift-users
On Sat, Jul 16, 2016 at 1:16 PM, Andrew Trick via swift-users wrote: > >> On Jul 16, 2016, at 5:28 AM, J.E. Schotsman via swift-users >> wrote: >> >> A mysterious bug has got me thinking about using UnsafePointer with >> NSData (Swift 2). >> >> Is this safe: >> >> let data:NSData = … >> let dat

Re: [swift-users] C Pointers and Memory

2016-07-28 Thread Dmitri Gribenko via swift-users
On Thu, Jul 28, 2016 at 1:27 PM, James Campbell via swift-users wrote: > How are arrays passed to C in Linux ? I tried unwrapping an optional array > in an if statment and passing it to c. it seemed like the array was > deallocated however if I stored it in a local var in the function before the >

Re: [swift-users] C Pointers and Memory

2016-07-29 Thread Dmitri Gribenko via swift-users
On Fri, Jul 29, 2016 at 12:55 AM, James Campbell wrote: > So this: > > if let data = someArrayGeneratingFunction() { > cFunction(UnsafeMutablePointer(data)) > } > > Has issues with the array passed to c getting corrupted, but this doesn't: > > let data = someArrayGeneratingFunction() > > if let

Re: [swift-users] C compatible structs

2016-08-01 Thread Dmitri Gribenko via swift-users
On Mon, Aug 1, 2016 at 4:20 AM, KS Sreeram via swift-users wrote: > Hello > > Is it possible to declare Swift structs that have C compatible memory > layout? The only supported way to do this is to declare your structs in a C header that you import in Swift as a module, and #include in your C lib

Re: [swift-users] Hi, About centos7.1 source compiler error '_swift_stdlib_unicode_strToLower'

2016-08-10 Thread Dmitri Gribenko via swift-users
On Wed, Aug 10, 2016 at 5:27 PM, SonWa via swift-users wrote: > /usr/bin/ld: stdlib/public/core/linux/x86_64/Swift.o: relocation > R_X86_64_PC32 against protected symbol `_swift_stdlib_unicode_strToLower' > can not be used when making a shared object > > /usr/bin/ld: final link failed: Wrong value

Re: [swift-users] libswiftCore.dylib was compiled with optimization - stepping may behave oddly;

2016-08-26 Thread Dmitri Gribenko via swift-users
On Fri, Aug 26, 2016 at 10:14 PM, David Liu via swift-users wrote: > Thank you Michael this really helps a lot, i really appreciate your help. > Here is the bug i filed. https://bugs.swift.org/browse/SR-2494 . > Also as a side question, this is my current method of trying to debug the > Standard L

Re: [swift-users] libswiftCore.dylib was compiled with optimization - stepping may behave oddly;

2016-08-27 Thread Dmitri Gribenko via swift-users
On Sat, Aug 27, 2016 at 2:12 PM, David Liu wrote: > Hi Dimitri, > > So i have built using ./utils/build-script -R --debug-swift-stdlib how ever > the REPL no longer has line numbers and i can not set a breakpoint via `:b` > and am unable to get to lldb to set breakpoints. > Thanks again for your h

Re: [swift-users] libswiftCore.dylib was compiled with optimization - stepping may behave oddly;

2016-08-28 Thread Dmitri Gribenko via swift-users
On Sun, Aug 28, 2016 at 12:51 AM, David Liu wrote: > Hi Dimitri > > Update, hardcoding the following in the build-script-impl and building > tool-chain > -DSWIFT_STDLIB_BUILD_TYPE="Debug" > -DSWIFT_STDLIB_ASSERTIONS=true > is working for me. These two options is what --debug-swift-stdlib expands

Re: [swift-users] Mapping a Dictionary to a Dictionary?

2016-08-29 Thread Dmitri Gribenko via swift-users
On Mon, Aug 29, 2016 at 11:36 PM, Jens Alfke via swift-users wrote: > I may be missing something obvious, but I can’t find a library function that > maps a Dictionary to another Dictionary, transforming the keys and/or values. > The only method I’ve found is the regular map(), which results in a

Re: [swift-users] Can we `override var hashValue`?

2016-09-02 Thread Dmitri Gribenko via swift-users
On Sat, Sep 3, 2016 at 1:31 AM, Zhao Xin via swift-users wrote: > func ==(lhs: Apple, rhs: Apple) -> Bool { > return lhs.name == rhs.name && lhs.shape == rhs.shape > } > > func ==(lhs: Banana, rhs: Banana) -> Bool { > return lhs.name == rhs.name && lhs.shape == rhs.shape > } There is no r

Re: [swift-users] Subtract a set of a subclass?

2016-09-02 Thread Dmitri Gribenko via swift-users
On Sat, Sep 3, 2016 at 4:47 AM, Zhao Xin via swift-users wrote: > Hi Jordan, > > Both you and I were wrong. > > My wrongness: Your so called principle should be applied here. > > Your wrongness: If you really want a different hash value, the parent > equality function has to be conservative and sa

Re: [swift-users] Synthesized Equatable Bug?

2018-01-15 Thread Dmitri Gribenko via swift-users
On Mon, Jan 15, 2018 at 2:30 PM, Jon Shier via swift-users wrote: > This is pretty straightforward code, so am I missing something here? Your '<' function does not define a valid strict total order. For let p1 = Point(1, 1) let p2 = Point(0, 2) neither of 'p1 < p2', 'p2 < p1', 'p1 == p2' is tr

Re: [swift-users] Failure to import SwiftShims at the REPL

2015-12-05 Thread Dmitri Gribenko via swift-users
On Sat, Dec 5, 2015 at 5:36 PM, Jason Dusek via swift-users wrote: > Hi List, > > On Ubuntu 14.04, trying out Swift from the REPL fails for me when > Swift is unable to find the SwiftShims module. All other aspects of > installation -- Clang 3.6, libicu-dev -- are correct as far as I can > tell. >

Re: [swift-users] REPL failed

2015-12-06 Thread Dmitri Gribenko via swift-users
On Sun, Dec 6, 2015 at 12:10 AM, Thomas# Chiang via swift-users wrote: > > Hi, > > I built swift for Linux(openSUSE 13.2) from source code, by > "./utils/build-script -R" command. > It works for run test.swift file, but can not run on REPL mode, > the error message is: > "LLVM ERROR: Compiler-int

Re: [swift-users] Parameter Validation

2015-12-07 Thread Dmitri Gribenko via swift-users
On Mon, Dec 7, 2015 at 9:25 AM, Jens Alfke wrote: > > On Dec 7, 2015, at 9:21 AM, Dmitri Gribenko wrote: > > Yes you can. Maybe not with the current XCTest, but there's nothing that > prevents unit-testing traps in principle. The standard library is already > doing that. See test/1_stdlib/Arra

Re: [swift-users] Parameter Validation

2015-12-07 Thread Dmitri Gribenko via swift-users
On Mon, Dec 7, 2015 at 10:02 AM, Jens Alfke wrote: > > On Dec 7, 2015, at 9:40 AM, Dmitri Gribenko wrote: > > There are > just two processes -- one is performing a trap, and another one is the > test harness that verifies that the other process terminated. > > > Ah — I thought it was some type of

Re: [swift-users] Parameter Validation

2015-12-07 Thread Dmitri Gribenko via swift-users
precondition() is enabled for release builds. On Mon, Dec 7, 2015 at 5:24 PM, David Hart via swift-users < swift-users@swift.org> wrote: > You enable assertions for release builds then? Remember, I'm talking > specifically about library code: the same way that calling NSArray's > objectAtIndex th

Re: [swift-users] Dynamic linker DT_RPATH

2015-12-10 Thread Dmitri Gribenko via swift-users
On Thu, Dec 10, 2015 at 1:43 AM, Ugo Arangino via swift-users < swift-users@swift.org> wrote: > > An other solution would be, to offer `.deb` packages for `libswiftCore.so` > ... > So other packages can have `libswiftCore.so` ... as package dependency. > In addition to this the Swift compiler can

Re: [swift-users] Recommendation for thread-safe dictionary

2015-12-10 Thread Dmitri Gribenko via swift-users
On Thu, Dec 10, 2015 at 9:24 AM, Pelaia II, Tom via swift-users < swift-users@swift.org> wrote: > /* provide subscript accessors */ > subscript(key: KeyType) -> ValueType? { > get { > var value : ValueType? > dispatch_sync(self.queue) { () -> Void in > value = self.internalDictionary[key] > } > re

Re: [swift-users] REPL failed

2015-12-10 Thread Dmitri Gribenko via swift-users
On Thu, Dec 10, 2015 at 9:59 AM, Daniel Dunbar wrote: > Actually, I am retracting this suggestion in favor of what I think is a > better one: > > What if we change the build process to build up a "composed package" as part > of the regular build. We would clear this at the start of each build, a

Re: [swift-users] Recommendation for thread-safe dictionary

2015-12-10 Thread Dmitri Gribenko via swift-users
On Thu, Dec 10, 2015 at 10:06 AM, Pelaia II, Tom wrote: > But isn’t that really a problem with that use case rather than the > concurrent dictionary itself? There are a lot of bad things one can do with > almost any code. For example, one can naively use the standard library > dictionary in subtle

Re: [swift-users] Recommendation for thread-safe dictionary

2015-12-10 Thread Dmitri Gribenko via swift-users
On Thu, Dec 10, 2015 at 11:20 AM, Jens Alfke wrote: > All we’re saying is that a class like this isn’t commonly useful enough to go > into a library. And too easy to misuse if provided. Dmitri -- main(i,j){for(i=2;;i++){for(j=2;j*/ ___ swift-users m

Re: [swift-users] Swift is building from source, failing tests.

2015-12-11 Thread Dmitri Gribenko via swift-users
On Fri, Dec 11, 2015 at 11:12 AM, Dylan Brown via swift-users < swift-users@swift.org> wrote: > Hello! When running `utils/build-script --clean -t`, I'm able to complete > the build but it regularly fails the same 4/6 tests. Also, check-swift and > check-swift-validation are not found in the build

Re: [swift-users] Swift is building from source, failing tests.

2015-12-12 Thread Dmitri Gribenko via swift-users
On Sat, Dec 12, 2015 at 6:57 AM, Dylan Brown via swift-users < swift-users@swift.org> wrote: > Answering my own question: I believe the `check-swift` tools for running > tests independently of the utils/build-script are not yet implemented. > Please correct me if I'm wrong, otherwise thread closed

Re: [swift-users] Running Swift on Ubuntu 12.04

2015-12-12 Thread Dmitri Gribenko via swift-users
On Sat, Dec 12, 2015 at 10:54 AM, Projjol Banerji via swift-users < swift-users@swift.org> wrote: > Hi, > I'm running a linux box with Ubuntu 12.04 on it and as none of the > official builds are for this particular version, I was wondering whether it > would be possible to run Swift on 12.04. > Fr

Re: [swift-users] Using NSObject subclass instance as key in Dictionary

2015-12-17 Thread Dmitri Gribenko via swift-users
On Thu, Dec 17, 2015 at 2:17 PM, Etan Kissling via swift-users < swift-users@swift.org> wrote: > I want to use instances of a custom class as Dictionary key. > This requires the class to conform to Hashable. > > func ==(lhs: KeyType1, rhs: KeyType1) -> Bool { return lhs.id == rhs.id } > > final cl

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Dmitri Gribenko via swift-users
On Fri, Dec 18, 2015 at 1:22 PM, Erica Sadun via swift-users < swift-users@swift.org> wrote: > 2. Is there a way to internalize the generator and not make it public? I'd > ideally like to hide all details except the fact that this is a sequence of > (Int, Int) > You can use AnySequence and AnyGen

Re: [swift-users] Cross Compiling Swift for Bare Metal?

2015-12-20 Thread Dmitri Gribenko via swift-users
On Sat, Dec 19, 2015 at 6:53 PM, Chaitanya Mannem via swift-users < swift-users@swift.org> wrote: > Hi, > > > I wanted to know if it is possible to compile swift code for bare metal. I > know there is a runtime but does swift depend on it to execute even if I > don't use those features?, can I dis

Re: [swift-users] REPL failed

2015-12-20 Thread Dmitri Gribenko via swift-users
On Sun, Dec 20, 2015 at 12:03 PM, Daniel Dunbar wrote: > > On Dec 10, 2015, at 11:07 AM, Dmitri Gribenko wrote: > > On Thu, Dec 10, 2015 at 9:59 AM, Daniel Dunbar > wrote: > > Actually, I am retracting this suggestion in favor of what I think is a > better one: > > What if we change the build pr

Re: [swift-users] (no subject)

2015-12-21 Thread Dmitri Gribenko via swift-users
On Mon, Dec 21, 2015 at 6:45 PM, John Huang via swift-users < swift-users@swift.org> wrote: > Dear swift team > > > >When I was installed swift and start it on command line, I try > to input 1 + 1, > > I got error “opening import file for module ‘SwiftShims’: No such file or > directo

Re: [swift-users] error: value of type 'Self.SubSequence' has no member 'Distance'

2015-12-23 Thread Dmitri Gribenko via swift-users
On Wed, Dec 23, 2015 at 3:24 PM, Daniel Eggert via swift-users wrote: > I have an array of String and need to call withCString on each one and then > pass the resulting array of UnsafePointer to a C api. The unsafe > pointer is only valid within the scope of withCString. > > So I built the follo

Re: [swift-users] Mac Toolchain is Unsigned?

2015-12-25 Thread Dmitri Gribenko via swift-users
On Fri, Dec 25, 2015 at 4:38 AM, swizzlr via swift-users wrote: > Merry Christmas all, > > While I wait for the rest of the family to arrive and the kids are slowly > going insane staring at presents, I’m doing some Swift dev. However, I note > that the latest Mac snapshot is unsigned – has it a

Re: [swift-users] What are .swift.gyb files?

2015-12-26 Thread Dmitri Gribenko via swift-users
On Sat, Dec 26, 2015 at 1:59 AM, J. Cheyo Jimenez via swift-users < swift-users@swift.org> wrote: > if I wanted to use that script to generate xctests, how do I feed it a > custom gyb file in? Is there a help file somewhere I can read? I know > this is not meant for that but it would be useful.

Re: [swift-users] build failure on FreeBSD

2015-12-26 Thread Dmitri Gribenko via swift-users
+ Davide On Sat, Dec 26, 2015 at 11:11 PM, Dan Mack via swift-users wrote: > Attempting to build swift from github from Dec 26th HEAD - after a few > adjustments I have gotton to this point where : > > [475/486] Linking CXX shared library > lib/swift/freebsd/x86_64/libswiftCore.so > > FAILED:

Re: [swift-users] Optionals inside Dictionary where Value = Any

2016-01-06 Thread Dmitri Gribenko via swift-users
On Wed, Jan 6, 2016 at 12:47 PM, Daniel Eggert via swift-users wrote: > I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is > this expected behaviour or a bug in Swift? > > /Daniel > > % swift > Welcome to Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, >

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

2016-03-18 Thread Dmitri Gribenko via swift-users
On Fri, Mar 18, 2016 at 10:53 PM, Will Stanton 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 `count`? Do

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] is inheritdoc available in swift?

2016-03-21 Thread Dmitri Gribenko via swift-users
On Mon, Mar 21, 2016 at 11:02 AM, Maciej Madaj via swift-users wrote: > Hi! > > I’m developing SDK for iOS, written purely in Swift - and I wonder is there > a way to use something similar to inheritdoc like in Java? Hi Maciej, This is a feature that we likely want on by default without any anno

Re: [swift-users] Looping through all values between UInt8.min and UInt8.max

2016-04-08 Thread Dmitri Gribenko via swift-users
On Fri, Apr 8, 2016 at 2:48 AM, tuuranton--- via swift-users wrote: > print(UInt8.min) //0 > > print(UInt8.max) //255 > > > //Is there an easy way to loop between all values > > //between (and including both) UInt8.min and UInt8.max? > > > //This doesn't work. > > //Runtime crash because UInt8.max