Re: [swift-users] ProcessInfo arguments when running as a script?

2016-08-18 Thread Jon Shier via swift-users
Jordan: You’re quite right. I knew something had been renamed but between Process and ProcessInfo I lost my way. Jon > On Aug 18, 2016, at 11:05 PM, Jordan Rose wrote: > > I’d be surprised if the behavior of ProcessInfo has actually changed. > Swift.CommandLine (formerly Swift.Proces

Re: [swift-users] ProcessInfo arguments when running as a script?

2016-08-18 Thread Jordan Rose via swift-users
I’d be surprised if the behavior of ProcessInfo has actually changed. Swift.CommandLine (formerly Swift.Process, unrelated to ProcessInfo) should have the script arguments only. Jordan > On Aug 18, 2016, at 19:14, Jon Shier via swift-users > wrote: > > Swift Users: > I’m trying to par

[swift-users] ProcessInfo arguments when running as a script?

2016-08-18 Thread Jon Shier via swift-users
Swift Users: I’m trying to parse the command-line arguments of a Swift 3 script using Xcode 8 beta 6. However, ProcessInfo’s arguments array now contains all of the swift compiler arguments as well as the command itself. For example, this script: #!/usr/bin/env swift import Foundation

[swift-users] Hi, About centos7.x source compiler error 'no such module 'SwiftGlibc''

2016-08-18 Thread SonWa via swift-users
Hi, Swift 3.0 Preview 6 code to run "./swift/utils/update-checkout --clone" by the script download. I have a new trouble,Centos 7.x run "./swift/utils/build-script -R" source code compiled is OK. But, run "./swift/utils/build-script --preset=buildbot_linux installable_package=/tmp/swift.tar.gz

Re: [swift-users] Bridging [String] to const char * const *

2016-08-18 Thread Kenny Leung via swift-users
Thanks! At least it’s good to know there wasn’t something trivial I was missing. -Kenny > On Aug 18, 2016, at 2:33 PM, Jordan Rose wrote: > > Here's how we do it for internal testing purposes: withArrayOfCStrings. The > callback is great because you don't have to worry about lifetimes. > > J

Re: [swift-users] Implicitly type conversion ?

2016-08-18 Thread Jens Alfke via swift-users
> On Aug 18, 2016, at 12:54 PM, Adel Zhang wrote: > > Any other situation when implicit type casting works? It would be better if > there is a reference or link. >From the Swift Programming Language book, the section “Optional Type”: The type Optional is an enumeration with two cases, none a

Re: [swift-users] Bridging [String] to const char * const *

2016-08-18 Thread Jordan Rose via swift-users
Here's how we do it for internal testing purposes: withArrayOfCStrings . The callback is great because you don't have to worry about lifetimes. Jordan > On Aug 18, 20

[swift-users] Bridging [String] to const char * const *

2016-08-18 Thread Kenny Leung via swift-users
Hi All. When interfacing with C, Swift does some magic to auto-convert Swift strings to char *. This is great, but passing an array of string pointers gets much more involved. The type translates to UnsafePointer> in Swift. So I originally tried to get pointers to the individual strings by usin

[swift-users] New Swift Snapshots Available!

2016-08-18 Thread mishal_shah via swift-users
New Swift Snapshots Available! Download new packages from https://swift.org/download/ Swift Development: (master) Following repository are tagged with swift-DEVELOPMENT-SNAPSHOT-2016-08-18-a https://github.com/apple/swift

Re: [swift-users] Implicitly type conversion ?

2016-08-18 Thread Adel Zhang via swift-users
Any other situation when implicit type casting works? It would be better if there is a reference or link. ---Original--- From: "Jens Alfke" Date: 2016/8/19 00:27:33 To: "adelzhang"; Cc: "swift-users"; Subject: Re: [swift-users] Implicitly type conversion ? On Aug 18, 2016, at 12:18 PM, adelzha

Re: [swift-users] Implicitly type conversion ?

2016-08-18 Thread Jens Alfke via swift-users
> On Aug 18, 2016, at 12:18 PM, adelzhang via swift-users > wrote: > > Why swift don't warn the type mismatch? I am woking on Xcode Version 7.3.1. It’s an implicit type-cast. Any type `X` can always be implicitly converted to type `X?` (i.e. `Optional`). —Jens

[swift-users] Implicitly type conversion ?

2016-08-18 Thread adelzhang via swift-users
I am confused by the code snippet following: func foo(_ value: Int?) { // do nothing } let a: Int = 2 foo(a) // it works! Why swift don't warn the type mismatch? I am woking on Xcode Version 7.3.1. ___ swift-users mailing

Re: [swift-users] Updating the swift.org examples

2016-08-18 Thread Daniel Dunbar via swift-users
Hi Joel, Thank you for pointing this out! > On Aug 18, 2016, at 3:14 AM, Joel Hughes via swift-users > wrote: > > Morning all, > > I've just upgraded to Swift 3 Preview 6 for Ubuntu and have noticed a few > changes. > > First using XCTest: "the name of a test module has no ‘Tests’ suffix" -

[swift-users] Updating the swift.org examples

2016-08-18 Thread Joel Hughes via swift-users
Morning all, I've just upgraded to Swift 3 Preview 6 for Ubuntu and have noticed a few changes. First using XCTest: "the name of a test module has no ‘Tests’ suffix" - easy to follow the error message, good stuff! And also reading command line args: Process.arguments Now available at: ProcessI

Re: [swift-users] How to get Swift 2.3 in command line?

2016-08-18 Thread Zhao Xin via swift-users
Thanks, Sam. However, as in Xcode-Beta.app, there are two version of Swift, 3.0 and 2.3, and 3.0 is chosen if I do your method. Zhaoxin On Thu, Aug 18, 2016 at 10:11 AM, Sikhapol Saijit wrote: > If you already have two versions of Xcode installed in the /Application > then I think using *xcode-

Re: [swift-users] Pointer conversions between different sockaddr types

2016-08-18 Thread Quinn "The Eskimo!" via swift-users
On 17 Aug 2016, at 18:55, Martin R via swift-users wrote: > - Are both solutions correct, should one be preferred, or are both wrong? Your `withMemoryRebound` solution is correct. > - Can the same be achieved simpler? Not without introducing a layer of abstraction. In my case I introduced a