Re: [swift-users] using "swift build" with code that depends on frameworks

2017-01-31 Thread Aaron Bohannon via swift-users
Hi, > > Yep the ordering was fixed in this PR: https://github.com/apple/ > swift-package-manager/pull/715 > SwiftPM will offer build settings in future to handle this properly. > > On Tue, Jan 31, 2017 at 11:05 PM, Aaron Bohannon via swift-users < > swift-users@swift.org&

[swift-users] using "swift build" with code that depends on frameworks

2017-01-31 Thread Aaron Bohannon via swift-users
I am trying to compile code for macOS that depends on the AudioKit framework. This can be done using `swiftc`, as long as one passes the flag `-target x86_64-apple-macosx10.11`. So, in theory, it should be possible to use `swift build` by passing it these flags: -Xswiftc -target -Xswiftc x86

[swift-users] Swift indentation for vim

2017-01-27 Thread Aaron Bohannon via swift-users
You have probably noticed that the available vim plugins do not provide robust support for automatic indentation of Swift code. The most complete vim plugin appears to be the one here: https://github.com/keith/swift.vim I found that its indentation script would frequently get confused, though. T

Re: [swift-users] another issue with tuples

2016-07-10 Thread Aaron Bohannon via swift-users
that you > remove the ‘throws’ keyword. > > What seems odd to me is not the first assignment, but rather the second > that _allows_ the use of ‘throws’ when t.1 (i.e. f) does not throw - is > your concern the same? > > Shane > > > On Jul 5, 2016, at 10:48 PM, Aaro

[swift-users] another issue with tuples

2016-07-05 Thread Aaron Bohannon via swift-users
Yesterday, it was pointed out that a variable name referring to a tuple cannot be used as a pattern. I have noticed another sort of inconsistency in how tuples are treated when they are referenced by name: func f() -> Int { return 5 } let t = ("a", f) let _: (String, () throws -> Int) = t // t

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

2016-06-29 Thread Aaron Bohannon via swift-users
I didn't really understand your answer, so I figured that I'd just experiment until I could see the pattern. Unfortunately, I found very few signs of any underlying pattern -- and I didn't even get a chance to experiment with generics. All I can see is behavior that is frighteningly inexplicable.

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

2016-06-28 Thread Aaron Bohannon via swift-users
f the function could match? On Tue, Jun 28, 2016 at 5:38 PM, Dmitri Gribenko wrote: > 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. &

Re: [swift-users] Simplify chained calls

2016-06-28 Thread Aaron Bohannon via swift-users
I think that's about as simple as you can make it unless you allow yourself to remove more than one element at a time when the minimum appears more than once. Here's the question I find interesting: what's the simplest way to change that code into a version based on lazy collections? After all, t

[swift-users] LazyCollection.map()

2016-06-28 Thread Aaron Bohannon via swift-users
Does the code below have a well-defined behavior? struct Nope: ErrorType {} func f(i: Int) throws -> Int { guard i < 5 else { throw Nope() } return i } do { let _ = try Array(0 ..< 10).lazy.map(f) print("lazy") } catch (let e) { print(e) } _

[swift-users] SignedNumberType protocol

2016-06-16 Thread Aaron Bohannon via swift-users
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? ___ swift-users mailing list swift-users@swift.org https://lists.swi

[swift-users] SequenceType vs. CollectionType

2016-06-14 Thread Aaron Bohannon via swift-users
Hi, I find the SequenceType protocol a bit confusing. My confusion is best explained in the context of a specific, real-world example. Let's say that I wanted to extend a protocol with a method "repeated(Int)" that would allow me to iterate over a collection of items multiple times, like this: