develooper Front page | perl.perl6.language | Postings from June 2005

Re: OO magic (at least for me)

Thread Previous | Thread Next
June 26, 2005 11:08
Re: OO magic (at least for me)
Message ID:

>>    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 implementation is, that ./ means 
self's method - and the class is not an instance, so it has no self.

./fun2 still not working at the second class's declaration.

> IIRC, that's what submethods are for. Submethods aren't inherited. It is
> unclear to me whether subs are.

Do you mean, that submethods for class methods (I don't know, if is it 
the official name of the non instance methods)? I don't think so.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About