Marshall wrote: > > Consider the following Java fragment: > > void foo() { > int i = 0; > int j = 0; > > // put any code here you want > > j = 1; > i = 2; > // check value of j here. It is still 1, no matter what you filled in > above. > // The assignment to i cannot be made to affect the value of j. > > }
True, but you have hidden the pointers. Semantically, the identifiers i and j refer not to integers but to locations that hold integers. The assignment modifies the location. > Those two local primitive variables cannot be made to have the same > identity. But you can update them, so this is an example of mutability > without the possibility of identity. The identity is temporal: You use the same variable name at two different times. Do you intend for the second `i' to mean the same variable as the first `i'? -- http://mail.python.org/mailman/listinfo/python-list