[Xotcl] Children object shadows parent objects method

Kristoffer Lawson setok at fishpool.com
Wed Nov 22 16:00:04 CET 2006


On Wed, 22 Nov 2006, Kristoffer Lawson wrote:

> It's probably not desirable but if you think about it, you can see why that 
> is happening. Objects are basically implemented as namespaces (well, at least 
> they were at some point). A method is a proc inside a namespace. Thus a::name 
> is the proc for that method. Now, objects are also commands. Placing it 
> inside the namespace will create, well, the command a::name, thus overriding 
> the method.

OK, I checked and the documentation does actually mention this behaviour 
so I guess it is desired. Check:

http://media.wu-wien.ac.at/doc/tutorial.html#obj-agg

                               / http://www.fishpool.com/~setok/


More information about the Xotcl mailing list