> On Jun 17, 2016, at 1:20 PM, Brent Royal-Gordon <[email protected]> 
> wrote:
> 
>> The required _ = try? on what used to be a BOOL result in ObjC is incredibly 
>> annoying, mostly with NSXML* classes on OS X where you really don't care 
>> about the error 99% of the time, but care just about the result 
>> (nodesForXPath, etc).
> 
> Are you in control of the XPath strings? If so, you should probably be using 
> `try!`, because any mistake in your queries would be a programmer error.

I might be, but I've come across XMLs where the XPaths were correct 
(confirmed), yet the nodes(forXPath:) failed with an error. Mostly when 
multiple namespaces were present.

> I'm also not sure why you would call `nodes(forXPath:)` in void context at 
> all—it doesn't have any useful side effects.

Sorry, this is my fault, kind of got side-tracked since I've recently dealt 
quite a lot with XML and it was freshly in my mind.

> 
> -- 
> Brent Royal-Gordon
> Architechies
> 

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to