[swift-users] Implementing a few statistics functions in Swift

2016-10-10 Thread Georgios Moschovitis via swift-users
Hey everyone, I would like to implement a few statistics functions in Swift (e.g. variance, standardDeviation, etc) that are computed over a collection. I am aware of this library: https://github.com/evgenyneu/SigmaSwiftStatistics My problem

Re: [swift-users] Implementing a few statistics functions in Swift

2016-10-11 Thread Georgios Moschovitis via swift-users
OK there seem to be some useful ideas in these two examples, let me study them :) Thank you. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

[swift-users] Monorepo workflow using SPM

2016-11-03 Thread Georgios Moschovitis via swift-users
The Swift Package Manager is a great addition to the Swift programmer's toolbelt and in general I like the integration with Git. However, since SPM promotes a separate Git repo per package and actually leverages Git tags to resolve dependency versions, I am wondering if it's possible to use the

Re: [swift-users] Monorepo workflow using SPM

2016-11-03 Thread Georgios Moschovitis via swift-users
> It would be good if you can explainyour requirements/features/floware you > looking for. Well the flow is simple, just put all your packages in one root repository. I guess, SPM could be updated to allow linking to a local dependency by file path, not only by Git tag. Actually this feature w

Re: [swift-users] Monorepo workflow using SPM

2016-11-09 Thread Georgios Moschovitis via swift-users
> Can you take a look at: > ... and see if you feel it would meet your needs? Thanks, it looks great :) One minor thing, I am not sure about the .Package(url: “…”, subpackage: ..., …) syntax, maybe the subpackage name should be included in the url? I am not sure… -g. __

[swift-users] Binary package dependencies

2016-12-02 Thread Georgios Moschovitis via swift-users
Hi, It would be great to be able to depend on 'binary' (i.e. precompiled) modules/packages using SPM. This would allow distribution of proprietary modules without the underlying source code, which is an important use-case. AFAIK, this is not possible at the moment, but I would love to be proven

[swift-users] inout generic struct parameter error

2017-01-01 Thread Georgios Moschovitis via swift-users
While getting my feet wet with Swift, I am still surprised with type-system ‘quirks’ here and there. I tried to implement a simple array of weak references: public struct WeakArrayIterator: IteratorProtocol { var array: [Weak] var index = 0 init(_ array: [Weak]) { self.a

[swift-users] Fwd: inout generic struct parameter error

2017-01-01 Thread Georgios Moschovitis via swift-users
> Begin forwarded message: > > From: Georgios Moschovitis > Subject: Re: [swift-users] inout generic struct parameter error > Date: 1 January 2017 at 11:26:11 PM GMT+2 > To: David Sweeris > >>> This kinda works but because we pass a struct at: >>> the ‘garbage collection’ at: >>> doesn’t affe

Re: [swift-users] inout generic struct parameter error

2017-01-01 Thread Georgios Moschovitis via swift-users
Hey Ben, Thank you for taking the time to provide this detailed explanation. Very helpful indeed. George. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] inout generic struct parameter error

2017-01-02 Thread Georgios Moschovitis via swift-users
> But if you do this you will get a different compiler error, because your > struct will no longer conform to Sequence, which requires makeIterator to be > non-mutating. This is important, especially assuming your array is eventually > going to conform to Collection as well. One of the requireme

[swift-users] How to use an SPM library in an (Xcode based) iOS project?

2017-01-19 Thread Georgios Moschovitis via swift-users
I have created a nice little library with SPM ($ swift package init --type=library). The library includes some utility classes and associated tests. It works as expected. Now, I would like to use this library within an iOS application. AFAIK, SPM doesn't support iOS at the moment. I am wondering

Re: [swift-users] How to use an SPM library in an (Xcode based) iOS project?

2017-01-19 Thread Georgios Moschovitis via swift-users
> You can then reference it from another Xcode project or workspace. I am aware of `generate-xcodeproj` but can you provide a link with details about the ‘reference’ part? As an Xcode newbie, it’s not obvious to me how to do it. thanks, George. ___ sw

Re: [swift-users] How to use an SPM library in an (Xcode based) iOS project?

2017-01-19 Thread Georgios Moschovitis via swift-users
Thank you, will check it! George ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

[swift-users] XML parsing on Linux, with Swift 3.1

2017-09-04 Thread Georgios Moschovitis via swift-users
Hi, I would like to parse an RSS feed using Swift 3.1 on Linux. I tried to use Foundations’s XML but I only managed to get segmentation faults. Is this supposed to work on Linux? I have only seen examples on iOS. Apart from that a quick search didn’t reveal any useful XML parsing library compat

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-04 Thread Georgios Moschovitis via swift-users
As an example, this SegFaults: import Foundation class ParserDelegate: NSObject, XMLParserDelegate { func parserDidStartDocument(_ parser: XMLParser) { print("Starting document") } func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, q

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-05 Thread Georgios Moschovitis via swift-users
es > attributeDict: [String : String]) { > print("*** \(elementName)") > } > } > > let xml = "George" > let test = ParserDelegate() > test.startParsing(xml) > > On Sep 05, 2017, at 02:24 PM, Georgios Moschovitis via swift-users > mailto:s

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-05 Thread Georgios Moschovitis via swift-users
On Sep 5, 2017, at 1:01 AM, Georgios Moschovitis via swift-users >> wrote: >> >> Hi, >> >> I would like to parse an RSS feed using Swift 3.1 on Linux. >> I tried to use Foundations’s XML but I only managed to get segmentation >> faults. >> I

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-06 Thread Georgios Moschovitis via swift-users
> XMLParser’s delegate is unowned, so it’s being deallocated when you exit the > current scope. Hold on to it with a strong reference: > > let delegate = ParserDelegate() > xmlParser.delegate = delegate Wow! Need to brush-up my understanding of Swift ‘pointers’ Thank you.___

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-06 Thread Georgios Moschovitis via swift-users
FWIW, I also prefer snake_case, but camelCase is unfortunately the standard convention in Swift so I use that. Also, I avoid using libraries that don’t follow standard conventions. -g. ___ swift-users mailing list swift-users@swift.org https://lists.s

Re: [swift-users] XML parsing on Linux, with Swift 3.1

2017-09-09 Thread Georgios Moschovitis via swift-users
Thank you, I wasn’t aware of XMLDocument. I managed to get XMLParser to work for my use case though… -g. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

[swift-users] Is URLSession actually working on Linux

2017-10-03 Thread Georgios Moschovitis via swift-users
I implemented a simple RSS feed aggregator. I used code like... let data = try! Data(contentsOf: feedURL) or let session = URLSession(configuration: URLSessionConfiguration.default) let task = session.dataTask(with: url, completionHandler: completionHandler) task.resume() ...to fetch the data.

Re: [swift-users] Is URLSession actually working on Linux

2017-10-05 Thread Georgios Moschovitis via swift-users
> There has been a reasonable amount of work put in recently, particularly with > Data and URLSession. > > You can have a look at the list of open issues for Foundation on Linux: > > https://bugs.swift.org/issues/?jql=status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component

Re: [swift-users] Is URLSession actually working on Linux

2017-10-05 Thread Georgios Moschovitis via swift-users
I am wondering, is there an ETA for 4.0.1 ? -g. > On 5 Oct 2017, at 8:58 PM, Georgios Moschovitis > wrote: > >> There has been a reasonable amount of work put in recently, particularly >> with Data and URLSession. >> >> You can have a look at the list of open issues for Foundation on Linux:

Re: [swift-users] Happy new year Swift community.

2018-01-01 Thread Georgios Moschovitis via swift-users
Happy new year! Greetings from Cyprus :) George. > On 1 Jan 2018, at 1:42 AM, Adrian Zubarev via swift-users > wrote: > > Well some of you guys have to wait a little longer, but I can already wish > everyone a happy new year from Germany. 🎉🎊🎆🎇 > > -- > Adrian Zubarev > Sent with Airmail >