[swift-evolution] ++ and --

Ross O'Brien narrativium+swift at gmail.com
Wed Mar 23 08:33:44 CDT 2016


I'd be willing to keep "++" and "--" if they stopped having a return type.
"x++" is fine; "let y = x++" is where we lose clarity, so I'd much prefer
to see that expressed as "let y = x + 1; x++".

On Wed, Mar 23, 2016 at 1:10 PM, Ergin Bilgin via swift-evolution <
swift-evolution at swift.org> wrote:

>     First of all, I am not a big fan of removal of "++" operator. Still,
> "+= 1" has the same performance with "++" but since I like the comfort of
> writing just "++", I will just write an extension when Swift 3 will be
> released. I know many people who will do the same.
>
> On 23 March 2016 at 13:09, Tino Heth via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> I think that ++ and — should stay and MUST be implemented as faster
>> operations than += and -=.
>>
>> If there is an easy way to make operations faster, imho that should be
>> applied to every method ;-)
>>
>> Jokes apart, compilers of today know some really smart tricks, so if "+=
>> 1" is slower than "++", I'd consider that a bug.
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160323/3afd6dc9/attachment.html>


More information about the swift-evolution mailing list