[swift-evolution] [Pitch] Retiring `where` from for-in loops
me at lmpessoa.com
Fri Jun 10 06:39:34 CDT 2016
I would vow to remove where clauses altogether. Most of the times I used it in ifs, fors and switches I ended up thinking it hardened readability of my code (perhaps because of placement, but I do not think alternatives made it more readable) and so it was my decision to stop using where whenever possible in my code. Since Erica's performance test pointed out using guard is nearly as fast as using where and the core team is removing wheres from ifs, I think the ones in fors could go next.
> On 10 Jun 2016, at 2:01 am, Charlie Monroe via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jun 9, 2016, at 7:16 PM, Erica Sadun <erica at ericasadun.com> wrote:
>>> On Jun 9, 2016, at 11:11 AM, Charlie Monroe <charlie at charliemonroe.net> wrote:
>>> See my latest post - included results with -Ofast. But still, using filter and lazy.filter is 10+% slower, which were the suggested alternatives to `where`.
>> I need to correct this misapprehension.
>> My suggested alternative to where was and remains `guard`.
>> -- E
> Sorry, meant alternatives that didn't require any additional code in the body of the for loop.
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution