On Wed, Jun 15, 2016 at 4:58 PM, Dany St-Amant via swift-evolution < [email protected]> wrote:
> > > Le 15 juin 2016 à 17:23, Jean-Daniel Dupas via swift-evolution < > [email protected]> a écrit : > > > > > >> Le 13 juin 2016 à 17:26, Erica Sadun via swift-evolution < > [email protected]> a écrit : > >> > >> > >>> On Jun 13, 2016, at 9:23 AM, let var go via swift-evolution < > [email protected]> wrote: > >>> > >>> I am 100% with Charlie on this. Expressiveness has to do with the > *effectiveness* of conveying a thought or a feeling. > >>> > >>> Keep "where". It is expressive. It conveys a specific idea effectively > and concisely. > >> > >> For those of you in favor of retaining `where`, how do you feel about > adding `while`, `until`, `unless`, etc? > >> > >> — E > > > > What I like is the possibility to iterate over a filtered list using a > ‘single’ statement, not the keyword itself. If you propose to replace where > by something less confusing, or add other keywords, I’m all for it. > > > > For the folks who like the 'where' and do not like the 'guard .. else > continue', (also considering in the equation the suggestion of renaming > 'where' by 'if'). One can get the 'where' syntax without the 'where' at > the cost of one indentation level and the set of curly braces. > > for element in dataArray { > if condition { > doWork() > } > } > > versus > > for element in dataArray where condition { > doWork() > } > ...and (not that I would advocate for this as the best style), you could simulate the keyword with a slightly funny indentation: ``` for element in dataArray { if condition { doWork() }} ``` (...and if we're counting letters typed as a metric for terseness, not that I would advocate that metric, `where` and `if {}` are both exactly five...) > Dany, slowly shifting into the "what's the point of keeping 'where'" camp > :) > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
