> On Apr 8, 2016, at 10:46 AM, Антон Жилин via swift-evolution 
> <[email protected]> wrote:
> 
> Right, `infix` operators without a precedence group logically should be able 
> to be used, just with parentheses everywhere.
> 
> But users will most likely want to use such operators with `=` without 
> parentheses. It means, such operators should still belong to some precedence 
> groups.
> 
> I suggest that for each such operator, an separate unnamed group should be 
> created. It will have no associativity and precedence greater than Ternary (I 
> actually agree this is the right choice).
> 
> I also think it is OK that other operators will not be able to specify 
> precedence relation with such "unprecedented" operators

Right, I agree.  I consider it to be the "safe default" for an operator to be 
non-associative and unordered with respect to all other operators.  This would 
require using parentheses to disambiguate, which seems safer than a default 
precedence level.  This proposal also eliminates the notion of a strictly 
ordered set of precedences.

I do think it is useful to be able to specify precedence relationships without 
having to define a “group”, to avoid boilerplate when you have one operator at 
a logical level (“??” for example).

-Chris
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to