[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bindings and assignments



>>>>> "Perry" == Perry E Metzger <perry@piermont.com> writes:

Perry> Michael Sperber <sperber@informatik.uni-tuebingen.de> writes:
>> >>>>> "Perry" == Perry E Metzger <perry@piermont.com> writes:
Perry> Is there any sort of straightforward definition of "binding" and
Perry> "assignment" that one can reference to explain the distinction to
Perry> people?
>> 
>> Binding means associating a name with a (fixed) value.  In your
>> garden-variety imperative language, this means associating the name
>> with a memory cell to hold a value.  Assignment means changing the
>> contents of the memory cell associated with the variable: throwing out
>> the old value, putting in a new one.

Perry> That's only true conceptually if variables are always using pointers
Perry> to the bound value, is it not? [...]

No, the conceptual basis remains the same.  This is purely an
implementation detail, and a program can't tell the difference.  (And,
if you're trying to explain things, my very strong advice is *not*
mentioning this implementation detail to non-compiler hackers.  SICP,
for example, is terrible in this respect, and its explanation of the
environment model is completely unusable for beginning programmers.)

Perry> What I'm really looking for is a pair of definitions with a bit
Perry> more formalism that I can point people to.

What kind of formalism do you have in mind?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla