passing by refference

Donn Cave donn at u.washington.edu
Thu May 15 19:31:53 EDT 2003


Quoth Doug Quale <quale1 at charter.net>:
| "Fredrik Lundh" <fredrik at pythonware.com> writes:
... [ quoting account of CLU system (by Barbara Liskov?) ]
...
|>     Objects that do not exhibit time-varying behavior are called
|>     _immutable_ objects, or constants.  Examples of constants are
|>     integers, booleans, characters, and strings.  The value of a
|>     constant object can not be modified.  For example, new strings
|>     may be computed from old ones, but existing strings do not
|>     change.  Similarily, none of the integer operations modify the
|>     integers passed to them as arguments.
|
| Same as Scheme and Lisp except that strings are mutable in those languages.

What does ``the value of a constant object cannot be modified'' mean?
Is it possible that by "value", the author means the computer data
represented by the object?

| This is a description of call-by-value using CLU values (object
| references).  Note that CLU values used in variable assignment and the
| binding done by argument passing are the same.  This is the key point.

Does this key point require that we always expect "value" in the
context of CLU to mean "object reference"?  Or would you agree that
this would actually be absurd, except in the context of "call-by-value"
where we know it must have that meaning because Python passes object
references, Python is like Scheme and Scheme is call-by-value?

	Donn Cave, donn at u.washington.edu




More information about the Python-list mailing list