4 ms·
Addition, as implemented by Python, is functional. There are no side effects. A fully imperative encoding of addition would be eg. the x86 add instructions. Joh
by willtim 11y ago
Addition, as implemented by Python, is functional. There are no side effects. A fully imperative encoding of addition would be eg. the x86 add instructions. John Backus gave us "functional" arithmetic with Fortran, but realised all values should should be treated this way, not just numbers.
I take your point about the iterators being mutated and the loss referential transparency. That's certainly not functional programming.
- Veedrac 11y ago> Addition, as implemented by Python, is functional. Sure, but Python wasn't the first imperative programming language. (An aside: that's not strictly true anyway; the error thrown when you do 1 + [] is a side effect.)