Sam Ruby wrote:

Are namespaces subject to garbage collection? Classes may be created on the fly in Python, and disapear just as quickly.

In Python as well as in Perl. We have to deal with that anyway. Perl6 has the notion of lexically scoped multimethods. Operator overloading only for one specific scope.


In the example, two objects with the same class have different implementations of a given method.

Fine. The find_method call has to consult the properties of the object too.

Furthermore, every assignment to any property of any instance has the potential of invalidating whatever caches you may have.

The assignment of a Sub PMC, yes. But if your implementation of find_method is able to locate a method now, you know already where and in which order you are searching. And if the implementation can overload e.g. a "add" method, you know where you have to call add_method to achieve that effect.


I don't see a problem here. Worst case is an uncached find_method call as you are doing now anyway in e.g. PyClass.

- Sam Ruby

leo



Reply via email to