anything like C++ references?
bokr at oz.net
Tue Jul 15 07:10:56 CEST 2003
On Tue, 15 Jul 2003 00:22:15 +0100, Stephen Horne <intentionally at blank.co.uk> wrote:
>>> C++ references are tellingly also called self-dereferencing pointers.
>>> They are not a distinct concept - they are syntactic sugar. I suspect
>>> they mainly arise out of the modern desire to disguise pointers and
>>> fantasize that they're not there, though they certainly work very well
>>> in certain contexts.
>>Syntactic sugar or no, they still behave differently than other
>>datatypes and are therefore not consistent... IMHO.
>They behave exactly like pointers. You just use different notation to
>get that behaviour. That is what makes them syntactic sugar.
BZZT. C++ references do not behave *exactly* like pointers. Try to make one
point to a different place than it was initialized to point to.
More information about the Python-list