Re: Strange error message with anon subroutine

2006-12-13 Thread Gaal Yahas
On Wed, Dec 13, 2006 at 11:31:33AM -0800, Ovid wrote: > *** Cannot use this control structure outside a 'routine' structure > at 99.pugs line 103, column 13-22 > > Take out the returns, and it works fine. Can someone tell me what I'm > missing? Is this a bug. Perl 6 differentiates betwe

Re: Strange error message with anon subroutine

2006-12-13 Thread Larry Wall
On Wed, Dec 13, 2006 at 11:31:33AM -0800, Ovid wrote: : In trying to compress a list, I wrote the following code: : : my $compress = do { : my $previous; : $compress = -> $x { : if !defined $previous or $x ne $previous { : $previous = $x; : $x; :

Strange error message with anon subroutine

2006-12-13 Thread Ovid
In trying to compress a list, I wrote the following code: my $compress = do { my $previous; $compress = -> $x { if !defined $previous or $x ne $previous { $previous = $x; $x; } else { (); } }; }