OO magic (at least for me)

2005-06-26 Thread BÁRTHÁZI András
Hi, I'm wondering, if it's possible with Perl 6 or not? class MyClass { method mymethod($par) { say mymethod called!; } } class ExClass is MyClass { mymethod(12); } # pugs myprog mymethod called! I would like to use mymethod to add ExClass some

Re: OO magic (at least for me)

2005-06-26 Thread Piers Cawley
BÁRTHÁZI András [EMAIL PROTECTED] writes: Hi, I'm wondering, if it's possible with Perl 6 or not? class MyClass { method mymethod($par) { say mymethod called!; } } class ExClass is MyClass { mymethod(12); } # pugs myprog mymethod called! I

Re: OO magic (at least for me)

2005-06-26 Thread BÁRTHÁZI András
Hi! I'm trying to answering my questions. Still interested in some official answer. :) --- 8 --- 8 --- 8 --- 8 --- 8 --- 8 --- 8 --- class MyMethod { method fun1() { fun2(); } method fun2() { say fun2!; } } class Child is MyMethod { } Child.fun1(); --- 8 ---

Re: OO magic (at least for me)

2005-06-26 Thread Juerd
BÁRTHÁZI András skribis 2005-06-26 19:35 (+0200): method fun1() { fun2(); } method fun2() { say fun2!; } *** No compatible subroutine found: fun2 fun2 is a method, not a sub. You need method syntax to call it: ./fun2; class MyMethod { method fun1() { fun2(); } sub fun2() { say

Re: OO magic (at least for me)

2005-06-26 Thread BÁRTHÁZI András
Hi, method fun1() { fun2(); } method fun2() { say fun2!; } *** No compatible subroutine found: fun2 fun2 is a method, not a sub. You need method syntax to call it: ./fun2; Hmm. It really works. :) I'm getting the idea, what's the difference between methods and subs. Anyway, my

Re: OO magic (at least for me)

2005-06-26 Thread Juerd
BÁRTHÁZI András skribis 2005-06-26 20:07 (+0200): Hmm. It really works. :) I'm getting the idea, what's the difference between methods and subs. Anyway, my implementation is, that ./ means self's method - and the class is not an instance, so it has no self. The invocant can be a class too.