why cannot assign to function call

Mark Wooding mdw at distorted.org.uk
Tue Jan 6 09:12:19 EST 2009


Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> wrote:

> I don't think so. Variables in algebra are quite different from variables 
> in programming languages. Contrast the statement:
> 
> x = x+1
> 
> as a programming expression and an algebraic equation. As a programming 
> expression, it means "increment x by one". But as an algebraic 
> expression, it means "x is some value such that it is equal to one more 
> than itself", and there is no solution to such an equation.

Surely there is.  The solution is: 1 = 0 (and hence x is an -- no, /the/
-- element of the trivial ring).

> > and how several generations of computer languages, not to mention
> > the actual machine language those generated, behaved, before the current
> > crop.
> 
> Sure. And?

Actally, this is true only for /very/ small values of `several'.  There
was FORTRAN in 1957, with what you're calling the `named bins' model,
and I call assignment-is-copying, and Lisp in 1958, with the assignment-
is-pointer-diddling model.

-- [mdw]



More information about the Python-list mailing list