Assignment versus binding

Marko Rauhamaa marko at pacujo.net
Tue Oct 4 04:35:18 EDT 2016


dieter <dieter at handshake.de>:
> The concept "assignment" comes from an operational semantics based on
> some form of "RAM" machine. Such a machine has storage cells where you
> can assign values to which remain there until overridden with a new
> value.
>
> The concept "binding" comes from a denotational semantics based on
> some form of functions where parameter names are bound to values on
> function "application" and do not change inside the function.

I wonder if such pure-bred functional programming languages exist. Lisp,
Scheme and Python don't belong to them, at least. Object-oriented
programming is not really possible without assignment. Even Scheme's
"letrec" appeals to assignment semantics.

Ultimately, "binding" comes from outside the computer world. You talk
about "bound variables" and "free variables". The concepts are needed to
define the semantics of predicate logic and lambda calculus, for
example. The C Preprocessor (cpp) comes close to the classic
binding/transformation semantics of lambda calculus.

> Thus, at an appropriate level of abstraction, you can say that
> "binding" and "assignment" are mostly equivalent.

Yes, but you sound more erudite if you talk about binding.


Marko



More information about the Python-list mailing list