Re: More fun with the perl 6 compiler.

2002-09-12 Thread Aaron Sherman
On Thu, 2002-09-12 at 09:58, Piers Cawley wrote: > > sub odd($n); > > > > first to declare the function. This gets you a warning about redefining > > odd, but that's ignorable. > > Odd... could have sworn I tried that. And I was under the impression > that official format for this was C<< sub od

Re: More fun with the perl 6 compiler.

2002-09-12 Thread Sean O'Rourke
On Thu, 12 Sep 2002, Piers Cawley wrote: > Heh. I tried predeclaring using the apocalypse style: > >sub odd($n) {...} >sub even($n) {...} > > And that complained about the yadda, even though the functions were > then fully defined. At the time I interpreted this as a stub definition, not

Re: More fun with the perl 6 compiler.

2002-09-12 Thread Piers Cawley
Aaron Sherman <[EMAIL PROTECTED]> writes: > On Thu, 2002-09-12 at 06:46, Piers Cawley wrote: > >> Here's the classic example of mutual recursion: >> >> sub even ($n) { >> given $n { >> when 0 { return 1 }; >> default { odd($n-1) }; >> } >> } >> >> sub odd ($n) { >>

Re: More fun with the perl 6 compiler.

2002-09-12 Thread Piers Cawley
"Sean O'Rourke" <[EMAIL PROTECTED]> writes: > On Thu, 12 Sep 2002, Piers Cawley wrote: > >> So, I know that recursion doesn't seem to work in the simple case, but >> at least it reaches runtime. Mutual recursion doesn't even compile >> successfully. > > It should do about this, since you're calli

Re: More fun with the perl 6 compiler.

2002-09-12 Thread Aaron Sherman
On Thu, 2002-09-12 at 06:46, Piers Cawley wrote: > Here's the classic example of mutual recursion: > > sub even ($n) { > given $n { > when 0 { return 1 }; > default { odd($n-1) }; > } > } > > sub odd ($n) { > given $n { > when 0 { return } > default {

Re: More fun with the perl 6 compiler.

2002-09-12 Thread Sean O'Rourke
On Thu, 12 Sep 2002, Piers Cawley wrote: > So, I know that recursion doesn't seem to work in the simple case, but > at least it reaches runtime. Mutual recursion doesn't even compile > successfully. It should do about this, since you're calling it with parens, but for the moment, you need to dec