[swift-evolution] [Discussion] Breaking precedence

Anton Zhilin antonyzhilin at gmail.com
Mon Aug 1 16:41:23 CDT 2016


Disclaimer: I have not (yet) prepared a proposal, or even something that
could be considered a draft, but I want to hear public opinion on the topic.

SE-0077 (about precedence groups) has been successfully implemented for
Swift 3. (A thousand thanks to John McCall!) It suggests a model where we
can prohibit certain operators from standing next to each other.

This was intended to be the second part of that proposal. We now have to
think if we should drop some precedence relationships between standard
operators. Here are examples of parentheses dropping that can be ambiguous
to reader:

1/3 as Double   // should we prohibit this?
1 | 2 ^ 3   // or this?
a && b | c   // or this?

Should we break standard precedence hierarchy and if yes, how?
For those involved in the mentioned proposal, how exactly should standard
precedence groups relate?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160802/374984ac/attachment.html>


More information about the swift-evolution mailing list