class, prototype, meta

Tom Morgan tmorgan at acm.org
Mon Mar 2 03:16:13 UTC 1998


Dave, 

Here is my try for motivating why assignment is a Big Deal, and a metaoperation.

If you write that every popular programming construct:

    I = I + 1

and then pretend your're in your high school algebra class, there is something
odd here.

The algebra class answer to

    I = I + 1

is "no, it is not", and changing the '=' into a left pointing arrow doesn't help.

Only the most malicious teaching assistant would so abuse notation as to
change the meaning of a symbol right there on one line.  Symbols have agreed
on values, which they retain throughout a given context.

In order to make sense of assignment statements, it helps to think of
accessing a variable's value as evaluating a function, a function which always
returns the same value.

Thought of that way, assignment of a new value to a variable amounts to
changing the program that computes that value.

If invoking a function is a base level operation, then changing a function is
reasonably a meta level operation.

   ...Tom M 
   Tom Morgan





More information about the Squeak-dev mailing list