On Wed, Nov 25, 2015 at 11:48 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: > I think "binding" is too fancy a word to be used with conventional > programming languages like Python. If your programming language has an > assignment statement, "binding" is even nonsensical. Consider: > > def f(x): > x += 1 > return 2 * x > > Now we would have this reduction: > > f(7) > => > 7 += 1; return 2 * 7 > > because "x" would be bound to "7" everywhere in the function body.
This is exactly the sort of problem that inevitably happens when you try to extend mathematics into programming. Most branches of mathematics are simply looking at pure, eternal statements of truth; if once you discover (or decide) that x is equal to 7, you can perfectly substitute one for the other in any context. There is no chronology - x has always been equal to 7, you just didn't know it until now. It's possible to write code this way, and there are benefits to it, but as soon as you have an assignment operator, you're introducing a whole aspect of chronological truth that math lacks, so some concepts ARE going to need to be modified. However, that doesn't stop us from making use of terminology, where it's helpful. We know from grade school that adding two numbers together and dividing by 2 gives us the average, or the midpoint between them. Programming languages introduce the notion of adding two strings together, and also throw the curve-ball at us that sometimes the average isn't the same as the perfect mathematical average (due to rounding or other issues). But we'll still call that operation adding, and we'll still have avg() functions that do what we broadly expect. ChrisA -- https://mail.python.org/mailman/listinfo/python-list