Brandon S. Allbery KF8NH wrote:
On Jul 7, 2009, at 08:13 , Jonathan Worthington wrote:
Brandon S. Allbery KF8NH wrote:
I was trying to figure out how to do it with nextsame, but that's not looking very simple.

On the other hand, if they were multis then they get added to the multi candidate list and therefore you can nextsame into them. Again from Rakudo:

> role R { multi method b() { say "lol in role" } }
> class C does R { multi method b() { say "oh hai in class"; nextsame } }
> C.new.b
oh hai in class
lol in role

But even then that's only half of it; we want a() from one role and b() from another, when both roles do a() and b(). Looks painful to me.

Right, and deference is the Wrong Tool For The Job in that case. The right answer is more like:

class C does R1 does R2 {
   method a() { self.R1::a() }
   method b() { self.R2::b() }
}

Thanks,

Jonathan

Reply via email to