[Tutor] SENTINEL, & more

Alan Gauld alan.gauld at btinternet.com
Sun May 30 17:38:06 CEST 2010


"spir ☣" <denis.spir at gmail.com> wrote in

> *The* issue is custom objects don't know their names.

The objects don't have names.
They are referenced by names.
But the name has nothing to do with the object
it references. If multiple names reference the same
object which name is the object supposed to associate
itself with? The concept doesn't make any sense!

It makes some sense in a static language like C++ (well,
sometimes) because an variable is a block of memory
and the thing in that block can be associated with the
block's name (but that doesn't work for pointers for
the same reason as Python names don't work.)
But even with static vars you can have multiple
references to the static object so it breaks down
again...

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list