Re: [swift-corelibs-dev] Better integration with UNIX tools

2017-11-28 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Nov 28, 2017, at 8:00 AM, Tony Parker wrote: > > Why does it imply a run loop rather than one of many multithreading > possibilities (dispatch queue, starting one more thread, etc)? And even if it > did use run loops, why is that a problem? The problem is simply that we're discussing usi

Re: [swift-corelibs-dev] Better integration with UNIX tools

2017-11-27 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Nov 27, 2017, at 11:01 PM, Brent Royal-Gordon > wrote: > > We aren't today Sorry, this part of the sentence got mangled in editing. What I meant to say is, script-style programs currently don't run under a runloop, so if this API is being designed for scripting use, a completion handler

Re: [swift-corelibs-dev] Better integration with UNIX tools

2017-11-27 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Nov 27, 2017, at 3:50 PM, Tony Parker via swift-corelibs-dev > wrote: > > I was thinking of perhaps a completion handler version, with the expectation > that once async/await style completions land it would be pretty easy to use > in a kind of straight-line mechanism. A completion handle

Re: [swift-corelibs-dev] Better integration with UNIX tools

2017-11-19 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Nov 19, 2017, at 7:01 PM, Abhi Beckert wrote: > > First of all, I disagree with Brent's assessment that we shouldn't have a > variant that "simply shells out". Even though this use case is "discouraged" > in other languages, I think in practice it definitely has a place. If you really wan

Re: [swift-corelibs-dev] Better integration with UNIX tools

2017-11-17 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Nov 17, 2017, at 11:34 AM, Tony Parker via swift-corelibs-dev > wrote: > > It does seem like there is a possibility of some better convenience API here. > > Any ideas on what form it would take? A class method on Process that returns > the output, maybe? `Process.run(_:arguments:terminat

Re: [swift-corelibs-dev] Bring NSString functions to String

2017-05-10 Thread Brent Royal-Gordon via swift-corelibs-dev
> On May 8, 2017, at 9:39 AM, Eric Blachère via swift-corelibs-dev > wrote: > > I was just wondering if there are plans to bring NSString functions > manipulating paths into the native String class. (such as lastPathComponent, > pathComponents etc...) > Because even if we can always make an ex

Re: [swift-corelibs-dev] Cancelable DispatchQueue.concurrentPerform

2017-02-24 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Feb 23, 2017, at 8:35 AM, Karl Wagner via swift-corelibs-dev > wrote: > > Would it be possible to make a cancelable version of > DispatchQueue.concurrentPerform, allowing you to abort any > yet-to-be-scheduled blocks? > > The use-case is for when you’re concurrently performing a job and

Re: [swift-corelibs-dev] Asynchronous Operations

2017-01-21 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Jan 20, 2017, at 7:55 AM, Ian Partridge via swift-corelibs-dev > wrote: > > Is there any way that we could support asynchronous operations in > swift-corelibs-foundation, in the absence of KVO? Could we add `willChangeValue(forKey:)` and `didChangeValue(forKey:)` methods just to `Operati

Re: [swift-corelibs-dev] Swift Shims

2016-08-03 Thread Brent Royal-Gordon via swift-corelibs-dev
> On Aug 3, 2016, at 8:39 PM, Fernando Rodríguez via swift-corelibs-dev > wrote: > > I'm having some trouble understanding what on Earth SwiftShims are. The name > probably makes it obvious to native English speakers, but it's not helping > me... > > Could someone please enlighten me? "Shim

Re: [swift-corelibs-dev] Foundation Renaming Question

2016-07-03 Thread Brent Royal-Gordon via swift-corelibs-dev
> In the past bare strings were acceptable for postNotificationName and > addObserverForName. Yet now constructing a Notification and > Notification.Name seem to be a bit unwieldy. Example: > > let ConnectedNotification= > Notification(name:Notification.Name(rawValue:"ConnectedNotificatio

Re: [swift-corelibs-dev] [swift-users] String manipulation (replacingOccurrences) in Linux swift

2016-05-26 Thread Brent Royal-Gordon via swift-corelibs-dev
> #if os(Linux) > print("Let's change those carriage returns...") > processedString = string.replacingOccurrences(of: "\r\n", with: > "\n") > #else > processedString = string.replacingOccurrences(of: "\r\n", with: > "\n") > #endif > And

Re: [swift-corelibs-dev] KVC dependent classes

2016-03-19 Thread Brent Royal-Gordon via swift-corelibs-dev
> Sorry, I said NSProgress but I meant NSPredicate. I personally can't even > imagine what a alternative API for NSPredicate would look like 🤔 Use reflection. Match against only dictionaries with string keys. Match against only objects conforming to some dictionary-with-string-keys-like protoc

Re: [swift-corelibs-dev] NSDecimal & NSDecimalNumber

2015-12-11 Thread Brent Royal-Gordon via swift-corelibs-dev
> This may be better suited to swift-evolution or users list, but regarding > fatalError do you have any techniques for testing this behavior? I believe the Swift compiler’s tests run code it expects to trap in a separate process and verify that the other process trapped. We may want to think ab

Re: [swift-corelibs-dev] NSAttributedString attributesAtIndex return an optional.

2015-12-08 Thread Brent Royal-Gordon via swift-corelibs-dev
> This may be better for the swift-evolution list, but I really do not like the > fact that subscripting is a "hard" error. I think the language should have as > little hard errors as possible to improve on how much the compiler can check > for you. I think the idea is that, if you’re subscript

Re: [swift-corelibs-dev] NSAttributedString attributesAtIndex return an optional.

2015-12-08 Thread Brent Royal-Gordon via swift-corelibs-dev
> Been playing around with NSAttributedString and cannot decide on the best way > to implement the (attributesAtIndex: effectiveRange) and other methods with > similar functionality. > > In the ObjC world I would expect an empty NSDictionary even in cases where > the location is greater than th

Re: [swift-corelibs-dev] [swift-evolution] Proposal: Conforming NSDate to Comparable

2015-12-05 Thread Brent Royal-Gordon via swift-corelibs-dev
> NSDate (and dates/timestamps in general) is a poor choice for Strideable, > because, DST. > A Calendar using this interface for a repeating event would be broken using > this. Or you would break anyone who really wants to iterate every fixed 86400 > seconds. Sometimes you want to add an inter

Re: [swift-corelibs-dev] [swift-evolution] Proposal: Conforming NSDate to Comparable

2015-12-05 Thread Brent Royal-Gordon via swift-corelibs-dev
> I think it's a good idea to conform NSDate to the Comparable protocol, so > instead of using: > > if someDate.compare(today) == .OrderedAscending { } > > Developers can easily compare using compare dates using comparison operators: > > if someDate < today { } I would also suggest we add Stri