[swift-evolution] [Accepted with Revision] SE-0099 Restructuring Condition Clauses

L. Mihalkovic laurent.mihalkovic at gmail.com
Thu Jun 9 03:21:56 CDT 2016


> On Jun 9, 2016, at 9:53 AM, Haravikk via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On 9 Jun 2016, at 02:47, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> comma should remain the condition separator, and the 'where' keyword can be retired from its purpose as a boolean condition introducer.
> 
> Can we get some clarification as to why ‘where’ is being chosen to be retired here? I’m deeply disappointed by that decision as enabling the consistent use of comma as a separator does not preclude the use of where for simple cases that don’t require it. I’m all for having a more usable separator for complex conditionals, but I rarely need it, meanwhile in common, simple conditional bindings and patterns I find the ‘where’ keyword a lot more readable, i.e:
> 
> 	if let value = foo where foo > 5 { … }
> 	if let value = foo, foo > 5 { … }

FWIW huge amounts of complex golang code have managed to exist with the latter syntax. I had difficulties with it when I started (I'm c,c++,java,c#,js,ts), but these days I would no longer question it.


> 
> The latter just doesn’t read as cleanly to me, and these are the kinds of simple conditionals that I use a lot of. As such as I’d still prefer to have ‘where’ be usable in the simple case, and I feel it was a mistake for the SE-0099 to have it tied to changes to the separator as the two changes aren’t mutually exclusive.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160609/6873ef4d/attachment.html>


More information about the swift-evolution mailing list