Re: [swift-users] بخصوص: Swift 4.0 bug in concurrent array access

2018-01-08 Thread Chris Lattner via swift-users
> On Jan 8, 2018, at 2:59 PM, Greg Parker via swift-users > wrote: > > >> On Jan 8, 2018, at 12:51 PM, Jordan Rose via swift-users >> mailto:swift-users@swift.org>> wrote: >> >>> On Jan 8, 2018, at 11:47, ⁨‫Fadi Botros‬ ‫⁩ <⁨botros_f...@yahoo.com >>> ⁩> wrote:

Re: [swift-users] How to determine LLVM version that Swift uses?

2018-01-02 Thread Chris Lattner via swift-users
> On Jan 2, 2018, at 10:10 AM, JJ Garzella via swift-users > wrote: > > Hi, > > As part of a research project, I'd like to perform static analysis on LLVM IR > files that Swift has generated. In order to properly analyze it, I need to > know which version of LLVM a particular version of Swif

Re: [swift-users] Why does the withUnsafeMutableBufferPointer closure take an inout parameter?

2017-10-16 Thread Chris Lattner via swift-users
> On Oct 13, 2017, at 7:40 PM, Andrew Trick via swift-users > wrote: > > > >> On Oct 12, 2017, at 3:52 AM, Geordie Jay via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> >> Guillaume Lessard via swift-users > > schrieb am Mi. 11. Okt. 2017 um 23:49

Re: [swift-users] [swift-evolution] [Proposal] Linux specific Package.swift file

2016-11-28 Thread Chris Lattner via swift-users
> On Nov 22, 2016, at 3:28 AM, rintaro ishizaki via swift-users > wrote: > > Hi Said, > > Since `Package.targets` is a mutable public property, > https://github.com/apple/swift-package-manager/blob/master/Sources/PackageDescription/Package.swift#L60-L67 > >

Re: [swift-users] Details of defer statement in Swift

2016-11-10 Thread Chris Lattner via swift-users
> On Nov 9, 2016, at 11:45 PM, Rien wrote: > > The manual says this: > > https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html > >

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-11-02 Thread Chris Lattner via swift-users
On Nov 1, 2016, at 9:50 PM, Shyamal Chandra wrote: > Hi Chris, > > First of all, there is tremendous instability with Xcode Playgrounds. Hi Shyamal, The vast majority of the instability of playgrounds is a result of the compiler code which is already open source. I look forward to you sendin

Re: [swift-users] Custom little/big endian data structure.

2016-11-01 Thread Chris Lattner via swift-users
> On Oct 30, 2016, at 12:50 PM, Adrian Zubarev via swift-users > wrote: > > Hi there, > > is there actually a way to build a custom data structure that will > automatically be converted to little/big endian on a little/big endian > system, just like (U)Int16/32/64 do? > > I could build as a

Re: [swift-users] clang builtins from Swift?

2016-10-03 Thread Chris Lattner via swift-users
> On Oct 2, 2016, at 6:24 PM, Jean-Denis Muys via swift-users > wrote: > > Hi, > > Xcode seems to think that [some] builtins can be used from Swift. It > autocompletes popcount for example, and command-clicking the function opens a > bona fide interface file, with the following declaration (

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Chris Lattner via swift-users
On Sep 13, 2016, at 5:34 PM, Shyamal Chandra wrote: > Hi Chris, > > Here is a forum question that I posted a while back. The latest post says to > file a bug under the bug report. > > Here's the post: > > https://forums.developer.apple.com/thread/61953 >

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Chris Lattner via swift-users
On Sep 12, 2016, at 3:03 PM, Shyamal Chandra via swift-users wrote: > Hope you are doing well! > > Swift is very volatile language that keeps on changing with every new version > of Xcode. When you are trying to run old code with different syntax, you run > into problems because the code is n

[swift-users] Swift 3.0 GM Candidate for Ubuntu

2016-09-09 Thread Chris Lattner via swift-users
I’m not sure if this got mentioned anywhere yet, but the Swift 3.0 GM candidate build is now up for Ubuntu: https://swift.org/download/#releases -Chris (just the messenger, not the person who did all the hard work to make this happen!) ___ swift-users

Re: [swift-users] C compatible structs

2016-08-02 Thread Chris Lattner via swift-users
> On Aug 1, 2016, at 9:12 AM, Dmitri Gribenko via swift-users > wrote: > > 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 y

Re: [swift-users] UInt8 in the REPL

2016-07-25 Thread Chris Lattner via swift-users
> On Jul 25, 2016, at 2:46 AM, KS Sreeram via swift-users > wrote: > > Hello > > In the Swift 2.2 REPL, UInt8(200) is displayed as -56. Is this a known > problem? “print” works fine though. Yep, this is already fixed in Swift 3. -Chris > > Best > KS Sreeram > http://claylabs.com

Re: [swift-users] is there a @rediscardableResult like rethrows?

2016-06-22 Thread Chris Lattner via swift-users
> On Jun 22, 2016, at 10:07 AM, David Ungar via swift-users > wrote: > > I like to use the pipe operator for a functional programming style: > > infix operator |> {associativity left precedence 100} > > public func |> ( x: A, f: @noescape (A) throws -> B ) rethrows -> B { > return try

Re: [swift-users] SignedNumberType protocol

2016-06-18 Thread Chris Lattner via swift-users
> On Jun 16, 2016, at 9:36 AM, Aaron Bohannon via swift-users > wrote: > > Why doesn't the SignedNumberType protocol include more operators? If a type > supports negation, subtraction, and 0, shouldn't we be able to assume that it > will support addition, as well? Hi Aaron, We expect to re

Re: [swift-users] Swift 3.0 and Xcode 7.3.x

2016-06-18 Thread Chris Lattner via swift-users
We’ll take a look, thank you for filing the radar Patrice! -Chris > On Jun 17, 2016, at 3:42 PM, Patrice Kouame via swift-users > wrote: > > Ouch! Good point. > I forgot that even the toolchain “snapshots” from the Swift team aren’t > official Apple releases. > Hope my Xcode 8 on El Capita

Re: [swift-users] Ambiguous parsing of `return`

2016-06-07 Thread Chris Lattner via swift-users
> On Jun 6, 2016, at 11:50 AM, Jens Alfke via swift-users > wrote: > > >> On Jun 6, 2016, at 11:46 AM, Daniel Dunbar > > wrote: >> >> Did you try an example? Swift warns about this for this very reason: > > I don’t get that warning with the latest Xcode 7.3.1

Re: [swift-users] super.init() called automatically?

2016-05-17 Thread Chris Lattner via swift-users
On May 17, 2016, at 2:48 AM, tuuran...@tutanota.de wrote: > Why is this the intentional behavior? Seems a bit strange that init() is a > special exception to the rule. Two reasons: 1) No one wants to call super.init() when deriving from NSObject. 2) More generally, if there is exactly one DI in

Re: [swift-users] Range subscript is ambiguous

2016-05-16 Thread Chris Lattner via swift-users
On May 16, 2016, at 10:09 AM, Joe Groff via swift-users wrote: > >> The oddity is that if I change the assignment to this >> >> var y : [Int] = Array(a[0..> >> then the compiler is happy. >> >> Shouldn’t it be able to do any necessary type inference from the fact that >> the expression is

Re: [swift-users] super.init() called automatically?

2016-05-16 Thread Chris Lattner via swift-users
> On May 16, 2016, at 7:09 AM, tuuranton--- via swift-users > wrote: > > Why does the following code compile? > Why does Bar's init(x: Int) automatically call Foo's init()? > Why don't I have to manually call super.init() myself? This is intentional behavior. It kicks in when your super class

Re: [swift-users] Initializing a UIColor

2016-05-11 Thread Chris Lattner via swift-users
> On May 11, 2016, at 7:37 AM, Erica Sadun via swift-users > wrote: > >> >>> On May 11, 2016, at 9:57 AM, Dennis Weissmann >> > wrote: >>> >>> Huh! There’s a new overload for that initializer: >>> >>> >>> >>> The one that takes CGFloats is the one that was

Re: [swift-users] String initializers and developer ergonomics

2016-05-09 Thread Chris Lattner via swift-users
On May 9, 2016, at 10:25 AM, Joe Groff via swift-users wrote: >> This seems like a tricky gotcha for developers who aren't extremely familiar >> with both the String and reflection APIs. His code looked reasonable at a >> first glance and I didn't suspect anything was wrong until I profiled it.

Re: [swift-users] Nil coalescing operator (??) and function vars

2016-04-19 Thread Chris Lattner via swift-users
> On Apr 18, 2016, at 11:42 AM, Peter Eddy via swift-users > wrote: > > Hello, > > I'd like to understand why I'm unable to use the nil coalescing operator with > functions. > > For example, I'd like to write a function that takes an optional function as > a parameter and that uses the nil

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

2016-04-15 Thread Chris Lattner via swift-users
> 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, &g

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

2016-04-14 Thread Chris Lattner via swift-users
> 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, but I think Swift doesn't handle that cases. > (it is not a real issue in a mod

Re: [swift-users] Question out of curiosity: why "func"

2016-04-07 Thread Chris Lattner via swift-users
> On Apr 4, 2016, at 7:25 AM, Jim Malak via swift-users > wrote: > > My background going into Swift was everything but JavaScript. One thing I > often wondered about (usually every time I forgot to type it) is what purpose > does requiring the keyword “func” serve when defining or decaling a

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] What do DSE and NFC mean ?

2016-01-03 Thread Chris Lattner via swift-users
> On Jan 2, 2016, at 11:25 PM, Jacob Bandes-Storch via swift-users > wrote: > > I believe these are Dead Store > Elimination, and "No Functional Change" (reassurance for why tests weren't > added along with a commit, or that a commit is so minor it d

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Chris Lattner via swift-users
/listinfo/swift-corelibs-dev <https://lists.swift.org/mailman/listinfo/swift-corelibs-dev> -Chris > > Dan > >> On Dec 23, 2015, at 8:39 AM, Chris Lattner via swift-users >> mailto:swift-users@swift.org>> wrote: >> >>> >>> On Dec 23, 20

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Chris Lattner via swift-users
> On Dec 23, 2015, at 8:22 AM, Joshua Scott Emmons via swift-users > wrote: > > >> On Dec 23, 2015, at 10:06 AM, Isaac Gouy via swift-users >> wrote: >> >> afaict the Swift concurrency story on Apple platforms has been GCD. >> >> What's going to be the Swift concurrency story on Linux? >

Re: [swift-users] C vararg: Swift Package Manager and System Modules

2015-12-18 Thread Chris Lattner via swift-users
> On Dec 17, 2015, at 1:47 PM, Daniel Eggert via swift-users > wrote: > > If I need access to the C fcntl(2): > > int fcntl(int, int, ...) > > can I get the swift-package-manager or swift-build-tool to compile C code > that wraps this into a non-vararg version: Hi Daniel, I’m pretty sure

Re: [swift-users] Pure Swift, cross platform way to open, read/write files?

2015-12-08 Thread Chris Lattner via swift-users
> On Dec 8, 2015, at 8:55 PM, Brent Royal-Gordon via swift-users > wrote: > >> But at the same time I get your point just use #if #else #endif to >> conditional import / call functions... but coding like that doesn't seem >> vary fun... reminds me of looking a C code that was meant to be comp