On Wed, Sep 03, 2008 at 11:22:42AM -0700, chromatic wrote:
> On Wednesday 27 August 2008 07:26:00 Moritz Lenz wrote:
> > Carl MXXsak (via RT) wrote:
> 
> > > r30589:
> > > $ cat for-loop-recursion.bug
> > > sub f($l) {
> > >     return() if $l <= 0;
> > >     say "entering $l";
> > >     for 1..3 {
> > >       f($l-1);
> > >       say "looping in $l";
> > >     }
> > > }
> > > f(2);
> >
> > I re-worked that as a test and added it to t/spec/S04-statements/for.t
> 
> If you or Carl can provide a PIR program which exhibits he problem, I'll fix 
> it.

As of r37064, it's now possible to do this using the --target=pir
option to rakudo:

    $ cat for-loop-recursion.bug
    sub f($l) {
        return() if $l <= 0;
        say "entering $l";
        for 1..3 {
          f($l-1);
          say "looping in $l";
        }
    }
    f(2);
    
    
    $ ./parrot perl6.pbc --target=pir --output=for.pir for-loop-recursion.bug
    $ ./parrot for.pir
    entering 2
    entering 1
    looping in 1
    looping in 0
    looping in -1
    looping in 2
    looping in -2
    looping in -3
    $

Currently the perl6.pbc has to be somewhere where load_bytecode can
find it (current directory or runtime/parrot/library) -- I'm still
thinking about RT #47992 before deciding when/how I want it to be
installed somewhere.

Pm

Reply via email to