[swift-evolution] [swift-evolution-announce] [Review] SE-0105: Removing Where Clauses from For-In Loops
james at supmenow.com
Thu Jun 23 11:10:05 CDT 2016
-1 Where provides a nice clarity when distinguishing the clauses from the
*James⎥Head of Trolls*
*james at supmenow.com <james at supmenow.com>⎥supmenow.com <http://supmenow.com>*
*Runway East *
*10 Finsbury Square*
* EC2A 1AF *
On 23 June 2016 at 16:59, Shawn Erickson via swift-evolution <
swift-evolution at swift.org> wrote:
> I am -0.5 on removing the where clause. I will note that removing it now -
> given the appearing limited usage - shouldn't cause a large disruption to
> most users. It may allow us time to think more about it and things related
> to it since it can be added back at a later point without breaking swift 3
> I personally was bitten by misusing where with a for-in, I had the mental
> model that it would abort the loop. To be honest I am not sure why I had
> that mental model given long history with SQL where clause and using where
> heavily in switch case statements (e.g. acts as a filter). I think for some
> uses I had an assumption that the optimizer could prove that the where
> would in fact always filter past a certain loop point and that may have
> screwed up my mental model in the general case.
> If you make such a mistake with where you may never know because from a
> line debugging perspective your loop content never gets executed if the
> where is violated yet you may still be looping (possibly causing
> destructive consumption or a performance issue).
> With that said I do find the syntax fairly clean and helpful when using
> for-in (if not abused by chaining many together). I don't have a better
> name for it, if it stays around I think it should stay named where to align
> with where in other constructs in the language.
> I do think for completeness we should consider adding 'until' for abort
> looping case. We should also consider moving the location of the where (and
> potential until) on the other side of 'in'.
> One negative to this syntax (assuming not abused) is not being able to
> probe things with a line based debugger. Of course many compact constructs
> in the language are that way. ...maybe someday lldb and Xcode could allow
> for statement scoped breakpoints
> On Wed, Jun 22, 2016 at 9:12 PM Chris Lattner <clattner at apple.com> wrote:
>> Hello Swift community,
>> The review of "SE-0105: Removing Where Clauses from For-In Loops" begins
>> now and runs through June 29. The proposal is available here:
>> Reviews are an important part of the Swift evolution process. All reviews
>> should be sent to the swift-evolution mailing list at
>> or, if you would like to keep your feedback private, directly to the
>> review manager.
>> What goes into a review?
>> The goal of the review process is to improve the proposal under review
>> through constructive criticism and contribute to the direction of Swift.
>> When writing your review, here are some questions you might want to answer
>> in your review:
>> * What is your evaluation of the proposal?
>> * Is the problem being addressed significant enough to warrant a
>> change to Swift?
>> * Does this proposal fit well with the feel and direction of
>> * If you have used other languages or libraries with a similar
>> feature, how do you feel that this proposal compares to those?
>> * How much effort did you put into your review? A glance, a quick
>> reading, or an in-depth study?
>> More information about the Swift evolution process is available at
>> Thank you,
>> -Chris Lattner
>> Review Manager
>> swift-evolution-announce mailing list
>> swift-evolution-announce at swift.org
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution