On Tue, 26 Apr 2005, Aaron Sherman wrote:

On Tue, 2005-04-26 at 09:58, Abhijit Mahabal wrote:
On Tue, 26 Apr 2005, Aaron Sherman wrote:

It also might be useful for roles to be able to delete members and
methods from a class like so:

        role foo {
                has $.x;
                has not $.y;

But that brings up the issue of who has the final authority. In class composition, a method defined in the class hides those in the roles, and in this sense it is the boss on "adding decisions".

So, as you can see, in the case of mixins, the hypothetical:

        role z {
                has not mymeth;

would, in fact, remove mymeth from $x, and in class composition, it
would remove the method from parents, but not from the class being
declared (as it should not, by my way of thinking).

Assuming that mymeth isn't AUTOMETHed, isn't that equivalent to saying:

role z{
    method mymeth([EMAIL PROTECTED]) {...}

Moreover, how does 'has not' work with multis? Does it clobber multi's of all signatures? what if you have something like:

class A { multi method foo($x){ something } }
role  B { has not foo; has not die;}
class C is A does B {...}

# the theft of ... for real code does make writing pseudocode harder!

I am just thinking aloud. I do like the proposal at least somewhat, and was wondering if it could be used as an aid in refactoring: an easy way to comment out methods to see if we have forgotten to change a call somewhere.

Abhijit Mahabal      http://www.cs.indiana.edu/~amahabal/

Reply via email to