Re: Code execution during compilation

2014-06-16 Thread Kamil Kułaga
I found it myself this won't work because when using multiple files and pir compilation INIT / END block parent class will be executed anyway. Is there way to postone to runtime class attribute without doing it manually? On Sun, Jun 15, 2014 at 10:34 PM, Kamil Kułaga wrote: > Ok, > > I've read

Re: Code execution during compilation

2014-06-15 Thread Kamil Kułaga
Ok, I've read SYN-04 Phasers and I think I should use INIT {} or END {} Are there any situations INIT {} / END {} will not postpone execution? Because in my case it is still executed during compilation https://github.com/teodozjan/lacuna-cookbuk/tree/init_problems On Sun, Jun 15, 2014 at 12:45 P

Re: Code execution during compilation

2014-06-15 Thread Moritz Lenz
Hi, class and role bodies are executed at compile time, so yes, that's expected. The same thing happens in BEGIN blocks. (Actually, the case with roles is more complicated; iirc their bodies are executed at role application time, but in your example, 'class B does Xx' runs at compile time, so the

Re: Code execution during compilation

2014-06-14 Thread Kamil Kułaga
Of course ment perl6 --target=pir --output=o.pir funnyrole.pl but with same effect On Sun, Jun 15, 2014 at 2:31 AM, Kamil Kułaga wrote: > Hi, > > I got amazed little bit when this code: > class A { > method wow{say "I'm alive"} > } > > role Xx{ > my $th = A.wow; >

Code execution during compilation

2014-06-14 Thread Kamil Kułaga
Hi, I got amazed little bit when this code: class A { method wow{say "I'm alive"} } role Xx{ my $th = A.wow; } class B does Xx { } Started to live during compilation (also tried with ufo): $ perl6 -o o.pir funnyrole.pl I'm alive Is this expecte