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
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;
:
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 {
();
}
};
}