[swift-evolution] [Discussion] Breaking precedence

Xiaodi Wu xiaodi.wu at gmail.com
Tue Aug 2 13:36:21 CDT 2016


On Tue, Aug 2, 2016 at 1:07 PM, Anton Zhilin <antonyzhilin at gmail.com> wrote:

> 2016-08-02 19:08 GMT+03:00 Xiaodi Wu <xiaodi.wu at gmail.com>:
>
>> That's an excellent point, actually. Would there be downsides not yet
>> considered?
>>
>> On Tue, Aug 2, 2016 at 11:03 Félix Cloutier <felixcca at yahoo.ca> wrote:
>>
>>> These expressions mix two types of logic that have different
>>> implications. For instance, `a * 16` and `a << 4` are "mostly equivalent",
>>> except that `a * 16` will crash on overflow. In these cases, I find that
>>> grouping provides some visual insulation that groups off the somewhat
>>> subtle differences.
>>>
>>> Félix
>>>
>>
> So it at least makes sense to create a proposal about this:
>
> RangeFormation < Addition < Multiplication
> RangeFormation < BitwiseOr < BitwiseAnd < BitwiseShift
>
> Pretty much everyone says that moving Ternary below Assignment would be a
> regression.
> I feel like a bit more discussion is needed on this:
>
> Another concern is NilCoalescing, which can be thought to be semantically
>> similar to Ternary. And at the same time it looks like || and &&, which
>> would bring it between LogicalConjunction and Comparison.
>> Also, do Casting and RangeFormation stand where they should?
>
>
> Someone said that this is actually not what was planned -- sure, it may
> need a separate proposal and a separate thread, but I think it's OK to use
> this one for now.
>

Anton, since this list is high-volume, people may skip entire conversations
because the subject line is not of interest to them. If you're going to
discuss additional topics, please do start new threads. That way, we can
get the maximum participation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160802/9311bdbc/attachment.html>


More information about the swift-evolution mailing list