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

Re: OO magic (at least for me)

Thread Previous | Thread Next
From:
=?ISO-8859-1?Q?B=C1RTH=C1ZI_Andr=E1s?=
Date:
June 26, 2005 11:08
Subject:
Re: OO magic (at least for me)
Message ID:
42BEEEDF.1060509@barthazi.hu
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 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.

Bye,
   Andras

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About