[swift-evolution] [DRAFT] Regularizing Where Grammar (was Re: Add a while clause to for loops)
Rob Norback
rnorback at gmail.com
Thu Jun 9 18:08:30 CDT 2016
After some research I finally get the reference. lol
La donna è mobile
Qual piuma al vento,
Muta d'accento — e di pensiero.
Sempre un amabile,
Leggiadro viso,
In pianto o in riso, — è menzognero.
È sempre misero
Chi a lei s'affida,
Chi le confida — mal cauto il cuore!
Pur mai non sentesi
Felice appieno
Chi su quel seno — non liba amore!English Translation of "La donna e
mobile"Woman
is flighty
Like a feather in the wind,
She changes her voice — and her mind.
Always sweet,
Pretty face,
In tears or in laughter, — she is always lying.
Always miserable
Is he who trusts her,
He who confides in her — his unwary heart!
Yet one never feels
Fully happy
Who on that bosom — does not drink love!
And to fully appreciate it, a youtube link:
https://www.youtube.com/watch?v=xCFEk6Y8TmM
Erica, thanks for the Opera lesson, and I look forward to seeing where this
proposal goes.
On Thu, Jun 9, 2016 at 3:11 PM L. Mihalkovic <laurent.mihalkovic at gmail.com>
wrote:
>
> On Jun 9, 2016, at 11:37 PM, Erica Sadun via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> On Jun 9, 2016, at 3:18 PM, Rob Norback <rnorback at gmail.com> wrote:
>
>
> Def like this change, but Erica I'm wondering what changed your mind about
> the syntax since the last I read you still were concerned by the ambiguity
> between filtering and exiting.
>
>
> My concerns remain. However, after going back and forth with Brent,
> wux, and others, I think my concerns could be addressed in style guides
> and linters[1]. This draft introduces a major consistency win, I get to
> rail
> against actually using the feature when I publicly opine[2], but when
> used it will be *better. *(I'm quite curious to see hear from someone on
> the
> core team whether this change is practical and whether it improves parsing
> or makes it harder from the compiler's point of view.)
>
> In any case, I reserve the right to argue from several different points of
> view[1, *ibid*] to see how well each suggestion works (and to hear the
> feedback
> and opinions of others) before settling on anything. Until it's a pull
> request, it's
> not fixed. And even then, I still want to listen to arguments.
>
> -- Erica
>
> [1] As the Italians say, "La donna è mobile
> <https://en.wikipedia.org/wiki/La_donna_%C3%A8_mobile>", which translates
> to "women are furniture." Ask an Italian.
>
>
> Poor Verdi... he wouldn't recognize his rigoletto in that 'new' light...
>
> [2] I find a `where`-less `for-in` loop with `guard` statements to read
> the most clearly and offer the most maintainable approach. My computation
> tests show that it is in the top efficiency group.
> [3] Nulla nota 3.
>
>
> On Thu, Jun 9, 2016 at 1:54 PM Erica Sadun via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> On Jun 9, 2016, at 1:57 PM, Haravikk <swift-evolution at haravikk.me> wrote:
>>
>> I think the idea here is for a change from the first to the second of:
>>
>> for eachValue in theValues where eachValue.isOdd { … }
>> for eachValue where eachValue.isOdd in theValues { … }
>>
>> I’m kind of split on this for a few reasons. The first is that it doesn’t
>> ready quite as well plain like this, however I find it looks a bit better
>> like:
>>
>> for (eachValue where eachValue.isOdd) in theValues { … }
>>
>>
>>
>> for eachValue where eachValue.isOdd in theValues { ... }
>> for case .Some(let value) where value > 5 in theValues { ... }
>>
>> vs
>>
>> for eachValue in theValues where eachValue.isOdd {...}
>> for case .Some(let value) in theValues where value > 5 { ... }
>>
>> It should be parseable without parens.
>>
>>
>> Just to clarify that what we’re looking for in theValues is “eachValue
>> where eachValue.isOdd”, though I could probably learn to read it like this
>> without parenthesis. That said, parenthesis lines up nicely with assignment
>> of tuples like:
>>
>> for (eachKey, eachValue where eachValue > 5) in theKeyValuePairs { … }
>>
>>
>> for (eachKey, eachValue) where eachValue > 5 in theKeyValuePairs {... }
>>
>> The where clause is distinct from the pattern
>>
>> -- E
>>
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>
> _______________________________________________
> 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/d0495b2a/attachment.html>
More information about the swift-evolution
mailing list