Label-Value (was: Re: Inheriting the @ sign from Ruby)
dnew at san.rr.com
Thu Dec 14 23:13:36 EST 2000
Alex Martelli wrote:
> > Well, X is a variable, and you can already change the value in X.
> This _may_ harbor a slight misconception, coming from other languages,
> that (in more complex cases) may interfere with optimal understanding
> of Python.
> There is no value *IN* x.
> A variable *REFERS TO* 'a value' (aka 'an object').
Well, I was being sloppy, but I did my graduate degree with Smalltalk so I'm
used to the model. I appriciate the attempt to clarify, tho. :-) The value
*in* X is the reference to the object, which is why asking whether it's
pass-by-value or pass-by-reference is confusing; it's
My point was, you don't *want* mutable integers. You want something else
that holds a pointer/reference/etc to an integer where you can change the
pointer. And X is such a thing already. The only problem is that you can't
share X, but that's a different problem, regardless of whether it's an
integer or a list. But if you want a single copy of a mutable integer, you
can implement it with a variable.
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST). Cryptokeys on demand.
Personal malapropism generator free with purchase!
Steganography: The manual is hidden in the source code.
Gold mining is only profitable because of the gold found.
More information about the Python-list