[swift-users] SwiftPM Test Fixtures

2016-11-17 Thread Ryan Lovelett via swift-users
If I have a number of `*.json` files that are meant to be loaded and used as a part of my SwiftPM test suite: 1. how do I get SwiftPM to bundle them with the test bundle? 2. how do I reference the fixtures in the test bundle? ## What I've tried... I tried creating a top-level directory called

Re: [swift-users] Understanding pass-by-value

2016-11-04 Thread Ryan Lovelett via swift-users
> I often end up “printing” the addresses or using GDB to take an inside > look. That is a really simple interrogation technique I wish I had thought of that! Thank you! > One thing that tripped me up: if you use inout variables, the observers > will be triggered once the function completes.

Re: [swift-users] Understanding pass-by-value

2016-11-04 Thread Ryan Lovelett via swift-users
> Do you mean, "did I make two copies of the `Data`, one in a top-level > variable named `d` and the other in a parameter named `buffer`"? That is more precisely what I meant. Mutters to self: "Precision of language, Ryan!" That fairly completely answers my quandary. Thank you for your time and

[swift-users] Understanding pass-by-value

2016-11-04 Thread Ryan Lovelett via swift-users
struct Foo { init(from buffer: Data) { bar = integer(withBytes: Array(buffer[4..<6])) baz = integer(withBytes: Array(buffer[6..<8])) ... } let d = Data(count: Int(3e+8)) let f = Foo(from: d) Did I just make two copies of the `Data`? How would I investigate this to understand

Re: [swift-users] IUO from C Library Interface

2016-10-24 Thread Ryan Lovelett via swift-users
> Not being able to assign the function reference is a bug. As a > workaround, you should be able to unsafeBitCast CC_SHA1_Update to the > appropriate type. > > -Joe Two questions: 1. Is this an already reported bug? If so, would you happen to know what it is so I can track it for resolution

[swift-users] Coerce NSData to Data

2016-10-14 Thread Ryan Lovelett via swift-users
I'm puzzeled by the behavior of the automatic coercion. Specifically when something will work and when it will not. It at least has something to do with the platform. That much I have tracked down. I've attached a file, bridge.swift, that on Linux will fail to compile with the error: cannot

Re: [swift-users] Building Swift 3 under ArchLinux

2016-07-19 Thread Ryan Lovelett via swift-users
I'll also plug my repo: https://github.com/RLovelett/swift-aur I use this to build from source on Arch. On Sun, Jul 17, 2016, at 03:44 PM, Farhan Ahmed via swift-users wrote: > Thank you Andrés. I will take a look at those packages from the AUR. > > Best, > Farhan > >> On Jul 16, 2016, at 9:34

Re: [swift-users] Porting Swift 2.2 to Swift 3.0

2016-06-23 Thread Ryan Lovelett via swift-users
On Thu, Jun 23, 2016, at 11:18 PM, Erica Sadun wrote: > >> On Jun 23, 2016, at 9:04 PM, Ryan Lovelett via swift-users > us...@swift.org> wrote: >> >> extension Dictionary { >> init(pairs: S) { >> self.init() >> for (key, value) in pairs { >> self[

[swift-users] Porting Swift 2.2 to Swift 3.0

2016-06-23 Thread Ryan Lovelett via swift-users
The following code does not compile in Swift 3.0 and it used to compile in Swift 2.2. I'm pretty sure it is a bug in Swift 3.0, since it used to work in Swift 2.2, but perhaps it was a bug that it worked in Swift 2.2. Help? extension Dictionary { init(pairs: S) { self.init()

Re: [swift-users] Hi,How running on Centos6 or Centos7?

2016-06-22 Thread Ryan Lovelett via swift-users
You will need to build from source. On Tue, Jun 21, 2016, at 08:14 PM, SonWa via swift-users wrote: > Hi,I see swift.org only version of Ubuntu. > Centos6 or Centos7 ask on how to runing? > _ > swift-users mailing list > swift-users@swift.org >

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 04:18 PM, Jens Alfke via swift-users wrote: > For completeness I should add that there are other cases where you need > to know the exact type: > > * When formatting a floating-point number, you should use 6 decimal > places if it's a float, 16 if it's a double. (If you

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 04:19 PM, Tony Parker wrote: > >> On May 24, 2016, at 1:11 PM, Ryan Lovelett > d...@ryan.lovelett.me> wrote: >> >> On Tue, May 24, 2016, at 04:07 PM, Tony Parker wrote: >>> Let’s get a bug into JIRA, then we’ll figure out what we should >>> do here. >> >> That's the

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 04:07 PM, Tony Parker wrote: > Let’s get a bug into JIRA, then we’ll figure out what we should > do here. That's the problem for me. What is the bug? Based on the code example I provided in this thread. I'm somewhat convinced that the bug is that Foundation on

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Ryan Lovelett via swift-users
lly. I was _expecting_ the Darwin behavior since that has always been the behavior. I was _not expecting_ the Glibc behavior as this is different than Darwin. All that having been said: I prefer the Glibc behavior. I'm not sure if this is expected behavior a bug. Or something else entirely. >

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-23 Thread Ryan Lovelett via swift-users
On Mon, May 23, 2016, at 04:33 PM, Jens Alfke wrote: > >> On May 23, 2016, at 12:25 PM, Ryan Lovelett via swift-users > us...@swift.org> wrote: >> >> However it seems that Foundation on Linux has neither >> `CFBooleanGetTypeID` or `CFGetTypeID`. > > Those ar

[swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-23 Thread Ryan Lovelett via swift-users
I am trying to run some Swift code that relies on Foundation on Linux (it is thoughtbot's Argo library if anyone wants to know the exact code). There is a fairly simple extension to NSNumber that looks like: import Foundation extension NSNumber { var isBool: Bool { return

Re: [swift-users] Crash in generic struct

2016-05-04 Thread Ryan Lovelett via swift-users
On Wed, May 4, 2016, at 10:41 AM, Jan E. Schotsman via swift-users wrote: > Hello, > > This code causes a segmentation fault: > > struct MyHeapElement > { > var index:Int > var key:T > } > > struct MyHeap > { > var elements = [MyHeapElement]() > } >

Re: [swift-users] Use Package Manager for iOS Development

2016-04-14 Thread Ryan Lovelett via swift-users
On Thu, Apr 14, 2016, at 07:54 AM, Marco Betschart via swift-users wrote: > > Dear Swift Users, > I’d like to use the Swift Package Manager for my dependency management > - regardless of it’s early stage: > Something like having the Swift Package Manager doing all the > dependency management work

Re: [swift-users] Failed to resolve REPL breakpoint

2016-01-04 Thread Ryan Lovelett via swift-users
/man/1/strip [2] https://github.com/RLovelett/swift-aur/blob/3498527dc392e391d77507579f075a8ebc4c78c0/PKGBUILD#L31-L33 On Wed, Dec 23, 2015, at 08:32 PM, Ryan Lovelett via swift-users wrote: > I have compiled from the latest Swift source and built a package for my > system using the i

Re: [swift-users] build-script was completed, how to install the binary file to /usr folder?

2016-01-04 Thread Ryan Lovelett via swift-users
Can you provide a little bit more context? Operating system...command you ran...etc... On Fri, Jan 1, 2016, at 03:15 AM, Quan Yong Zhai via swift-users wrote: > Hi, > The build-script was completed , how do I install the binary file to > /usr folder? > > Thanks in advance > > > >

[swift-users] Failed to resolve REPL breakpoint

2015-12-23 Thread Ryan Lovelett via swift-users
I have compiled from the latest Swift source and built a package for my system using the install to destination. However, after installing the package and running `swift` to test the REPL it dies with the following error: `error: failed to resolve REPL breakpoint for 'repl_main'`. Not really sure