Re: Argument scoping error or bug?

2008-10-27 Thread Patrick R. Michaud
On Sat, Oct 25, 2008 at 10:52:13AM +0200, Moritz Lenz wrote: Chris Dolan wrote: I stumbled across this issue while descending into a recursive Match structure. Consider the following reentrant subroutine: You have just experienced this bug:

Re: Argument scoping error or bug?

2008-10-25 Thread Moritz Lenz
Chris Dolan wrote: I stumbled across this issue while descending into a recursive Match structure. Consider the following reentrant subroutine: sub f($n) { for 0..$n - $i { say $i of 0..$n; if ($i == 4) { f(0); } } }; f(6); You have just

Argument scoping error or bug?

2008-10-24 Thread Chris Dolan
I stumbled across this issue while descending into a recursive Match structure. Consider the following reentrant subroutine: sub f($n) { for 0..$n - $i { say $i of 0..$n; if ($i == 4) { f(0); } } }; f(6); The value of the argument, $n, gets overwritten