[swift-evolution] Standard operator precedence

Xiaodi Wu xiaodi.wu at gmail.com
Sun Feb 14 01:42:46 CST 2016


Very well. May I ask what the rationale might be? I'm not sure I can deduce
it from the available documentation. In other circumstances where Swift
operators differ from C (e.g. overflow handling for addition, etc.), the
behavior is amply documented and the rationale quite clear. (I should add
that Swift documentation currently introduces these bitwise operators as
'familiar' to those coming from C and Objective-C before defining what they
are, which discourages careful study.)
On Sat, Feb 13, 2016 at 10:10 PM Chris Lattner <clattner at apple.com> wrote:

>
> > On Feb 13, 2016, at 6:32 AM, Xiaodi Wu via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> > Not sure if this is intentional, a bug, and/or a topic for evolution:
> >
> > In Swift, bitwise operators seem to have a different precedence in
> > relation to other operators than they do in (all other?) C-family
> > languages, at least per documentation.
>
> Yep, this is true, and this is intentional.  Swift has a greatly
> simplified and rationalized set of precedences, and yes, that means they
> differ from C.
>
> -Chris
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160214/733f7bf2/attachment.html>


More information about the swift-evolution mailing list