Re: Unexpected behaviour calling method of attribute

2005-06-12 Thread Chip Salzenberg
On Sun, Jun 12, 2005 at 03:42:14PM +0200, Leopold Toetsch wrote: > Klaas-Jan Stol wrote: > >.sub __add method > > .param pmc self > > .param pmc left > > .param pmc right > > The function signatures of your __add methods are bogus. Since __add has defined semantics per Parrot, I think it's

Re: Unexpected behaviour calling method of attribute

2005-06-12 Thread Leopold Toetsch
Klaas-Jan Stol wrote: method __add(left, right) { b.__add(left, right); //*** } .sub __add method .param pmc self .param pmc left .param pmc right The function signatures of your __add methods are bogus. Pd = Pl + Pr is the same as: Pd = __add(Pl, Pr) or

Re: Unexpected behaviour calling method of attribute

2005-06-12 Thread Chip Salzenberg
On Sun, Jun 12, 2005 at 12:43:17PM +0200, Klaas-Jan Stol wrote: > It seems that at the line, marked with "//***", not the __add method of > b is called, but that A's __add method is called again. Well, __add is a multimethod now, not a vtable function. I'm not surprised your code doesn't work as

Unexpected behaviour calling method of attribute

2005-06-12 Thread Klaas-Jan Stol
Hi, I have a class A, that has an object of class B as an attribute. I've overriden the add() method of class A, and I want to let class B handle the actual work. The idea is to make this class B replacable by the user, so he can override the behaviour of a certain object of A, without disturbi