3 ms·
I've always been a huge fan of the increment and decrement operators. I don't use them all the time, but they're very nice to have on occasion, and with operato
by OskarS 10y ago
I've always been a huge fan of the increment and decrement operators. I don't use them all the time, but they're very nice to have on occasion, and with operator overloading they can be made incredibly useful. I thought it was a very silly decision for Swift to remove them.
- Tempest1981 10y agoHere are some reasons that Python removed them: http://stackoverflow.com/questions/1485841/behaviour-of-increment-and-decrement-operators-in-python http://stackoverflow.com/questions/1485841/behaviour-of-incr... Edit: a nice write up by Chris Lattner: https://github.com/apple/swift-evolution/blob/master/proposals/0004-remove-pre-post-inc-decrement.md https://github.com/apple/swift-evolution/blob/master/proposa...
- dap 10y agoIt's very unfortunate that attempting to use preincrement and postincrement operators in Python results not in a syntax error, but in code that silently does something very unexpected.