[swift-evolution] Proposal: change infix operator attributes syntax to be more consistent with the rest of the language

Kevin Lundberg kevin at klundberg.com
Sun Mar 6 13:20:19 CST 2016


On 3/6/2016 12:21 AM, Developer wrote:
> I think there's something to this, but I'd prefer it look a bit more
> like what happened in SE-40
> (https://github.com/apple/swift-evolution/blob/714dd43863775705cebc77574287ab0974bfa615/proposals/0040-attributecolons.md)
> so 'associativity' and 'precedence' are made to look more
> compiler-construct-y.
>
> infix operator <> { 
>   @associativity(left)
>   @precedence(100)
> }
I'm not opposed to something like this either, however having actual
attributes inside curly braces here looks strange. I don't think
attributes are used in this way anywhere else.
> As for assignment operators, if memory serves syntax for them was
> quickly deprecated because they can be subsumed by making the LHS of
> an infix operator inout.  I'm not sure there needs to be much more at
> the declaration site than that.
If this is the case, then removing assignment from the declaration of
all the stdlib operators could also be part of this proposal, or broken
out into a separate one if necessary.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160306/6f57ec09/attachment.html>


More information about the swift-evolution mailing list